Nix-system-graphics: Seamless nix graphics on any Linux distribution

Hi there! :wave:

Ever felt tired by utilizing a plethora of NixGL-like hacks for simply running a graphical application on a Linux distribution other than NixOS? Well, nix-system-graphics takes inspiration from NixOS’s own graphics stack and implements it in a way any Linux distribution could include it, meaning Nix and other system packages can interoperate without any hacks.

Currently looking for people to help me test it out on more platforms, as its currently still in a very experimental and untested stage. Feel free to ask any questions here or otherwise open Github issues!

Thanks! :smile:

36 Likes

This doesn’t solve any of the issues that exist with GPU acceleration drivers but it does bring the level of issues to the same level as we have on NixOS.

I think it’d be good to endorse this as an officially supported method of running graphical apps on non-NixOS Linux as it should be bug compatible with NixOS which is officially supported of course.

Perhaps an easier version of simply creating a drivers Nix profile and symlinking it to /run/opengl-drivers imperatively that does not rely on experimental features or external projects could be added to the Nixpkgs manual.

Something like

$ sudo nix-env -iA nixpkgs.mesa.drivers -p /nix/var/nix/profiles/per-user/root/drivers

(and/or the relevant Nvidia package)

and then creating a simple systemd service which runs ln -s /nix/var/nix/profiles/per-user/root/drivers /run/opengl-drivers on boot.

3 Likes

I think the difficulty is that va-drivers and opencl-drivers are also separated from their traditional “driver” package. So there needs to be at least some level of collecting up into a meta-package involved realistically.

While system-manager is not the best, it does give a 1-to-1 experience as if setting up a NixOS machine with graphics drivers. Which i see as a good bonus of the tool.

I am planning and already looking into creating a non-flakes version of both system-manager and system-graphics. Current work on this is happening in Seperate out modules into `system-manager-modules` repo · Issue #117 · numtide/system-manager · GitHub

system-manager is also being eyed out for upstreaming to nixpkgs to allow for easier use as well.

Once those things are in place, i think there will be a lot less inputs and dependencies floating around than there are currently and talk of “officialness” could be done. But its very easy to mix together system modules with NixOS modules. So how they should be differentiated at that level needs to be looked into.

5 Likes

The glxGears reference in the logo is really nice

3 Likes