24
submitted 2 days ago by [email protected] to c/[email protected]

Nixgl: https://github.com/nix-community/nixGL

Also, it seems like this requires the latest "stateversion", since this is a new feature.

This is pretty big, because it makes it easy to use applications that use the GPU from nixpkgs on non Nixos systems.

top 6 comments
sorted by: hot top new old
[-] [email protected] 1 points 18 hours ago

Yeah this happened a while ago, it's been in stable since 25.05 i think. Nixgl isn't really a good solution for me though, but luckily i recently found another option of populating the /run directory with the nix drivers, the same way nixos does it. This seems to solve all the issues i had and makes nix on non-nixos much more powerfull to me. Since i can install game launchers and entire compositors with it, and programs that require the native system drivers will still be able to work inside of that nix-installed compositor. I'm thinking of switching back to void now and i'm working on a non-nix home manager setup.

[-] [email protected] 1 points 13 hours ago* (last edited 12 hours ago)

Can you share your setup? I'd really like that because I don't think nixgl works with GPPU apps like CUDA or lc0 (chess engine that uses gpu).

EDIT:

Is this it: https://github.com/juipeltje/configs/blob/54e971f6a6da47d6cfd02a6409be97d5e1051b0f/scripts/cron/nix-drivers.sh ?

Although this seems like it would just symlink opengl? What if I wanted GGPU like OpenCL or CUDA?

Edit2: wait, I think I might be misunderstanding how it works. I think nixgl already supports opencl, because it's mesa that implements opencl and opengl. But how would I get mesa support? I don't think the symlink to /run trick works.

[-] [email protected] 2 points 10 hours ago

Sorry for keeping you hanging, i actually got the idea from here you can ignore the nixgl stuff because that wouldn't be needed anymore, but the important part is building a derivation with those drivers in it, and then symlink those folders to /run. It should work with rocm/cuda as well but i haven't troed that yet. I've done some basic testing in a vm while i'm working on the config and so far for opengl stuff it has been working fine.

[-] [email protected] 1 points 2 days ago

I thought this was going to automatically wrap all my packages in NixGL. But this is about the way more convenient NixGL set-up that happened to home-manager last year, yes?

[-] [email protected] 2 points 1 day ago

Yeah, but I only discovered it now.

Looking on github though, it looks like people combine builtins.map with this to wrap a bunch of packages at once though.

[-] [email protected] 1 points 1 day ago

I'm also mapping the wrapper over a list and combining it with unmodified packages.

I suppose that is the Nix-y way, but I can't help but feel like it's a bit...manual? I always wondered if I should just wrap all of my home-manager packages that way!

this post was submitted on 07 Jul 2025
24 points (96.2% liked)

Nix / NixOS

2331 readers
33 users here now

Main links

Videos

founded 2 years ago
MODERATORS