Im doing the same thing right now and ran into a whole mess of issues lol. But I’ve only been using Nix for a week or so. Its hard to do on any regular distro but it is doubly as hard on Nix ngl. But what I had to do was add:
note the PCI ID’s “,” separated.
You can get this by running:
lspci -nn | grep -iE '(nvidia|amd)'
and finding your GPU. The Ids are in “[brackets:like_this]” You need both the GPU ID and the GPU Audio ID if you have it.
this will blacklist the GPU from getting attached to drivers from what I understand. Its a pain though. Also I also used Astrid’s blog as reference but it’s important to note that this is not a full guide and does skip some important steps. She just shows some of the adapted steps in NixOS.
I ran into a ton of issues, like virt-manager crashing because it didn’t have a GTK cursor enabled… and virt-manager not being to access any directory besides “/” lol I might also do a write up because all the existing docs are essentially nil
edit: lspci I believe is in pkgs.usbutils or pkgs.toybox I think. You can use “nix search nixpkgs lspci”
quick install of all my apps with a simple config file? check.
volatile system? check.
single use / runtime apps? check.
gpu-passthrough / gaming? check.
vms? check.
wish I could get it to work though.
sigh.
I’ll pay anyone that would help me set this up. I’ll send you a mobo+cpu. I will donate to your favorite charity. Anything… you name it. Help this geek out. I lack the technical knowledge to continue and after all this time I’m frankly burnt out.