Use nvidia 410 drivers on NixOS


I’m trying to use NixOS (18.09 or 19.03pre) for CUDA development, and need an nvidia driver newer than 390. Yet when I install nvidia, even though the nix expression clearly says that x64 platforms get the 410 version, my system (which is 64 bit) stubbornly installs version 390. What am I doing wrong? How do I customize this to get some other version, such as 396 or 410?




Hi, do you mind sharing your configuration.nix? It will help us figure out and reproduce the issue.


Its exactly the config you get when you do nixos-generate-config and add “nvidia” to the xorg.videoDrivers list. I’ll try again, see if the problem still exists with the current unstable installer, and paste the config, later today.



FWIW the 18.09 branch has NOT been updated to 410, only unstable:


Your original post says you tried both, but perhaps there was simply a bogon somewhere and you were only on 18.09, by chance? Just a thought.


Seems likely – which version do you get if you install using the 19.03pre installer? Alternatively, is doing nix-channel --add nixos and doing a nixos-rebuild switch --upgrade enough? How do I check which version of nixpkgs I’m using, as I agree that using the wrong version of nixpkgs seems the most likely cause…



nix-channel --list

as sudo, to show all installed channels.


nixos-version also outputs the current system nixos release.

Or cat /etc/os-release


For OpenCL it’s also required to set hardware.opengl.extraPackages accordingly.


IIRC 410 is relatively new on master; I find it likely that it wasn’t in nixos-unstable channel around a week ago.


Thanks! I think that was the problem. One related thing – is there a way to sub in a new sha256/URL and use a different version? I feel like overlays might be the answer I am looking for, but I’m hoping someone has a pointer to an example used on some other package…