nVidia installation: undefined variable "nvidia-x11"

I am trying to follow Nvidia - NixOS Wiki, but I get following error output

error: undefined variable 'nvidia-settings'

Google answered nothing, thus I am asking here.

Did a fresh install today. Think, I am using version 23.11 as base.

Had a blank screen at my DisplayPort. Fortunately, I have a HDMI screen, which works without any nVidia drivers.

sudo nix-channel --update did not change anything (source: Installation of a package returns Undefined Variable Error - #4 by NobbZ)


  • system: "x86_64-linux"
  • host os: Linux 6.1.72, NixOS, 23.11 (Tapir), 23.11.2962.b8dd8be3c790
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.18.1
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Given that link I can not see any code there that would mention nvidia-settings in nix code except for a single comment.

Can you please share more context? Like the code you have used and the full error message?

PS: Indeed nvidia-settings does not exist as a top-level package, nor can I find it otherwise!

1 Like

There is an nvidia-settings binary, normally installed by default when you enable the nvidia module, and it has a disable option that uses camel case: hardware.nvidia.nvidiaSettings.

Given this:

Make sure to allow Unfree Software. The unfree NVIDIA packages include nvidia-x11, nvidia-settings, and nvidia-persistenced.

Maybe @koppor is using an allowUnfreePredicate snippet that gets names from a list of packages, and gave it nvidia-settings, assuming that would exist?

Detective work isn’t what I’m here for though, please share your code if it’s not working!

1 Like

I was thinking that the text of the packages would

environment.systemPackages = with pkgs; [
vim
wget
nvidia-x11
nvidia-settings
nvidia-persistenced
];

I have removed these packages. works :tada:

I was not aware that I just had to follow the steps literally without any more implicit steps to do ^^.