Issues with Cinnamon / Plasa+xwayland in nixos 24.11 VM with Nvidia GPU passthrough or possibly something else?

Update:

In a VM with passthrough I tried to just install Linux Mint directly to see if this is a nix issue or not. When I installed Linux Mint it originally set me up in the VM with nouvaeu drivers, but i then used the GUI “Drivers” applet to install Nvidia proprietary drivers. Mint gave me the option to use “nvidia-driver-550” so I installed that rebooted… and it worked. I ran nvidia-smi and the nvidia gui settings to confirm it recognized the passed through card.

My conclusion from this is that there is so NixOS specific issue with the the nvidia drivers loading.

I’ve tried the following:

  1. Tied to use Nixos 24.11 + cinnamon with Nvidia on bare metal instead of passthrough. It is the same issues. I could not even load i3 when i switched to using the Nvidia card directly with proprietary drivers.

  2. I tried in my vm using the same version of the drivers as Mint was using successfully:

I tried both:

hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_550;

and manually specifying:

package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
  version = "550.120";
  sha256_64bit = "sha256-gBkoJ0dTzM52JwmOoHjMNwcN2uBN46oIRZHAX8cDVpc=";
...

Using either of these, I would also not get the greeter.

I confirmed with nvidia-smi that it was in fact using 550.120

I saw in some posts and wikis to try things like

boot.initrd.kernelModules = [ "nvidia" ];
boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ];

however, when I added this options and did nixos-rebuil switch I noticed it was then adding packages showing nvidia 565 instead of 550.

When I tried using nvidiaPackages.legacy_550; with the option services.xserver.videoDrivers = [ "nvidia" ]; it also tried to add in more current, unmatched stuff and gave me and error. When I manually specified the version, it allowed this setting.

At this point, I’m out of ideas. I have been using fresh VMs with the only things added were vim and then various nvidia settings. I am relatively certain I was using xwayland, etc with Nvidia when I first started playing with nix (24.05) a few months ago, because I only had the Nvidia card at the time and was specifically running into wayland issues.

I did try a fresh vm with 24.05 iso, but also got the same errors, so I am led to believe that something is not quite reproduceable here (why would it download 565 files if I am explicitly specifying 550?) or there is something I am missing.

Edit: I tried doing something similar to here: X refuses to start with Proprietary Nvidia Drivers - #6 by Gamer-Kold

but when I tried:

boot.extraModulePackages = [config.boot.kernelPackages.nvidiaPackages.legacy_550];

it told me 550 wasn’t an option, but 535 was. I tried legacy_535 and then also updated the driver to use “legacy_535”, but upon rebuild and reboot it would not boot X and nvidia-smi failed because it could not communicate with driver.