Builder for nvidia-x11-550.78-6.10.drv failed with exit code 2

That’s very odd, since you add that explicitly to environment.systemPackages, so it should be there whether the nvidia module is added to your system or not. Just to double check, you didn’t comment this out, right:

If you did, that’d explain why both of those are missing, given you special case on it for adding nvidia-settings.

I removed the comment on that, but now there’s an error I haven’t seen yet:

building the system configuration...
Traceback (most recent call last):
  File "/nix/store/0pjm3357ggwsjy1cghncdgxrlmsmh9lq-systemd-boot/bin/systemd-boot", line 397, in <module>
    main()
  File "/nix/store/0pjm3357ggwsjy1cghncdgxrlmsmh9lq-systemd-boot/bin/systemd-boot", line 380, in main
    install_bootloader(args)
  File "/nix/store/0pjm3357ggwsjy1cghncdgxrlmsmh9lq-systemd-boot/bin/systemd-boot", line 344, in install_bootloader
    raise e
  File "/nix/store/0pjm3357ggwsjy1cghncdgxrlmsmh9lq-systemd-boot/bin/systemd-boot", line 333, in install_bootloader
    write_entry(*gen, machine_id, bootspec, current=is_default)
  File "/nix/store/0pjm3357ggwsjy1cghncdgxrlmsmh9lq-systemd-boot/bin/systemd-boot", line 154, in write_entry
    initrd = copy_from_file(bootspec.initrd)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/0pjm3357ggwsjy1cghncdgxrlmsmh9lq-systemd-boot/bin/systemd-boot", line 146, in copy_from_file
    copy_if_not_exists(store_file_path, f"{BOOT_MOUNT_POINT}{efi_file_path}")
  File "/nix/store/0pjm3357ggwsjy1cghncdgxrlmsmh9lq-systemd-boot/bin/systemd-boot", line 61, in copy_if_not_exists
    shutil.copyfile(source, dest)
  File "/nix/store/h723hb9m43lybmvfxkk6n7j4v664qy7b-python3-3.11.9/lib/python3.11/shutil.py", line 269, in copyfile
    _fastcopy_sendfile(fsrc, fdst)
  File "/nix/store/h723hb9m43lybmvfxkk6n7j4v664qy7b-python3-3.11.9/lib/python3.11/shutil.py", line 158, in _fastcopy_sendfile
    raise err from None
  File "/nix/store/h723hb9m43lybmvfxkk6n7j4v664qy7b-python3-3.11.9/lib/python3.11/shutil.py", line 144, in _fastcopy_sendfile
    sent = os.sendfile(outfd, infd, offset, blocksize)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 28] No space left on device: '/nix/store/2rwmknq64mqq1kk2vq8sa2myv55b2qg3-initrd-linux-6.10.13/initrd' -> '/boot/EFI/nixos/2rwmknq64mqq1kk2vq8sa2myv55b2qg3-initrd-linux-6.10.13-initrd.efi'
warning: error(s) occurred while switching to the new configuration

You ran out of space in /boot. You’ll have to garbage collect some old generations with nix-collect-garbage --delete-older-than 5d or suchlike. Might need to do some manual deletion of old kernels in addition to that, I forget if the scripts delete old ones or deploy the new kernel first.

In addition, you might want to set a configurationLimit.

I set the configurationLimit to 5 and that worked. Well, there is still a problem with the Vulkan headers with the newest driver (which I still want due to issues in games).

Mind not adding the config.hardware.nvidia.package.settings.overrideAttrs thing to your packages just to confirm disabling nvidiaSettings actually works? The override looks correct, but I’ve not personally tested it.

Current config:

{ config, lib, pkgs, ... }:



{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
      ./modules/env.nix
    ];


  hardware.nvidia = {
    package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
      version = "560.35.03";
      sha256_64bit = "sha256-8pMskvrdQ8WyNBvkU/xPc/CtcYXCa7ekP73oGuKfH+M=";
      sha256_aarch64 = "sha256-s8ZAVKvRNXpjxRYqM3E5oss5FdqW+tv1qQC2pDjfG+s=";
      openSha256 = "sha256-/32Zf0dKrofTmPZ3Ratw4vDM7B+OgpC4p7s+RHUjCrg=";
      settingsSha256 = "sha256-kQsvDgnxis9ANFmwIwB7HX5MkIAcpEEAHc8IBOLdXvk=";
      persistencedSha256 = "sha256-E2J2wYYyRu7Kc3MMZz/8ZIemcZg68rkzvqEwFAL3fFs=";
    };

    # The nvidia-settings build is currently broken due to a missing
    # vulkan header; re-enable whenever
    # 0384602eac8bc57add3227688ec242667df3ffe3the hits stable.
    nvidiaSettings = false;

    modesetting.enable = true;
    # Power management is required to get nvidia GPUs to behave on
    # suspend, due to firmware bugs. Aren't nvidia great?
    powerManagement.enable = true;
    open = true;
  };

  # Bootloader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;
  boot.loader.systemd-boot.configurationLimit = 5;

  # Kernel
  #boot.kernelPackages = pkgs.linuxPackages_latest;
  boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_10;
  boot.blacklistedKernelModules = [ "amdgpu" ];
  boot.kernelParams = 
  [
    "amd_iommu=on"
 
    # slim HD 5450 650M 1GB DDR3
    #"vfio-pci.ids=1002:68f9,1002:aa68,"
    
    # thicc HD 4870 1GB DDR5
    "vfio-pci.ids=1002:9440,1002:aa30,"
  ];
  boot.kernelModules = [
    "vfio_virqfd"
    "vfio_pci"
    "vfio_iommu_type1"
    "vfio"
    "nct6775"
  ];
  boot.extraModprobeConfig = "options vfio-pci ids=1002:68f9,1002:aa68";
  boot.initrd.kernelModules = [ "nvidia" "nvidia_drm" "nvidia_uvm" "nvidia_modeset" ];
  #boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ];



  networking.hostName = "nixos"; # Define your hostname.
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.

  # Configure network proxy if necessary
  # networking.proxy.default = "http://user:password@proxy:port/";
  # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

  # Enable networking
  networking.networkmanager.enable = true;

  # Set your time zone.
  time.timeZone = "Europe/Berlin";

  # Select internationalisation properties.
  i18n.defaultLocale = "en_US.UTF-8";

  i18n.extraLocaleSettings = {
    LC_ADDRESS = "de_DE.UTF-8";
    LC_IDENTIFICATION = "de_DE.UTF-8";
    LC_MEASUREMENT = "de_DE.UTF-8";
    LC_MONETARY = "de_DE.UTF-8";
    LC_NAME = "de_DE.UTF-8";
    LC_NUMERIC = "de_DE.UTF-8";
    LC_PAPER = "de_DE.UTF-8";
    LC_TELEPHONE = "de_DE.UTF-8";
    LC_TIME = "de_DE.UTF-8";
  };

   services.udev.extraRules = ''
   # Pen Tablet
   SUBSYSTEM=="usb", ATTRS{product}=="XP-Pen Artist 12 (2nd Gen)", ATTRS{idProduct}=="094a", ATTRS{idVendor}=="28bd", MODE="0660", GROUP="plugdev"
   KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0666", GROUP="plugdev"

   # Arduino
   KERNEL=="ttyUSB*", SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", ATTRS{idProduct}=="7523", ATTRS{idVendor}=="1a86", MODE="0666", GROUP="plugdev"
   #SUBSYSTEMS=="usb", ATTRS{idProduct}=="7523", ATTRS{idVendor}=="1a86", MODE="0666", GROUP="plugdev"
   '';

  # file system shenanigans
  fileSystems."/mnt/Games" =
  {
    device = "/dev/disk/by-uuid/9226e50e-fc7b-4a95-baac-a59b1d779899";
    fsType = "ext4";
    options =
    [
      "users"
      "nofail"
      "x-gvfs-show"
      "exec"
    ];
    label = "Games";
  };

  fileSystems."/mnt/SeagateBarracuda" =
  {
    device = "/dev/disk/by-uuid/1b78ca3b-618f-496f-8a6e-d4e575f5d84b";
    fsType = "ext4";
    options =
    [
      "users"
      "nofail"
      "x-gvfs-show"
      "exec"
    ];
    label = "Seagate Barracuda";
  };

  fileSystems."/mnt/HGST" =
  {
    device = "/dev/disk/by-uuid/a18e9a89-3b84-4bc0-85fc-5828bd1e7342";
    fsType = "ext4";
    options =
    [
      "users"
      "nofail"
      "x-gvfs-show"
      "exec"
    ];
    label = "HGST";
  };

  fileSystems."/mnt/WinVM" =
  {
    device = "/dev/disk/by-uuid/3199b99a-c2f5-42c7-b41e-11d83b97da4d";
    fsType = "ext4";
    options =
    [
      "users"
      "x-gvfs-show"
      "exec"
    ];
    label = "WinVM";
  };

  fileSystems."/mnt/smb" = {
    device = "//192.168.0.16/nika";
    fsType = "cifs";
    options = let
      automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s,user,users";
    in ["${automount_opts},credentials=/home/nika/.dotfiles/smb-secrets,uid=1000,gid=100"];
  };

  # fuck nvidia
   services.xserver.videoDrivers = ["nvidia"];
#   hardware.nvidia = {
#     #package = config.boot.kernelPackages.nvidiaPackages.latest;
#     open = false;
#     #nvidiaSettings = true;
#     modesetting.enable = true;
#     powerManagement.enable = true;
#   };
#
#   #hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.latest;
#    hardware.nvidia = {
#      package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
#        version = "560.35.03";
#        sha256_64bit = "sha256-8pMskvrdQ8WyNBvkU/xPc/CtcYXCa7ekP73oGuKfH+M=";
#        sha256_aarch64 = "sha256-s8ZAVKvRNXpjxRYqM3E5oss5FdqW+tv1qQC2pDjfG+s=";
#        openSha256 = "sha256-/32Zf0dKrofTmPZ3Ratw4vDM7B+OgpC4p7s+RHUjCrg=";
#        settingsSha256 = "sha256-kQsvDgnxis9ANFmwIwB7HX5MkIAcpEEAHc8IBOLdXvk=";
#        persistencedSha256 = "sha256-E2J2wYYyRu7Kc3MMZz/8ZIemcZg68rkzvqEwFAL3fFs=";
#      };
#      nvidiaSettings = false;
#    };

  # Enable the X11 windowing system.
  # You can disable this if you're only using the Wayland session.
  services.xserver.enable = true;

  # Enable Wayland windowing system
#  services.displayManager.sddm.wayland.enable = true;

  # Enable the KDE Plasma Desktop Environment.
  services.displayManager.sddm.enable = true;
  services.desktopManager.plasma6.enable = true;

  # Configure keymap in X11
  services.xserver = {
    xkb.layout = "us";
    xkb.variant = "";
  };

  # Enable CUPS to print documents.
  services.printing.enable = true;

  # Bluetooth
  hardware.bluetooth = {
    enable = true;
    powerOnBoot = true;
  };

  hardware.sane = {
    enable = true;
    extraBackends = [ pkgs.sane-airscan ];
  };

  hardware.opentabletdriver.enable = true;

  # turn off the daemon service - it's borked afaik so for now I'll just use autostart until there either there's a fix or I'll fix it
  hardware.opentabletdriver.daemon.enable = true;

  services.hardware.openrgb.enable = true;

#  Create WiFi Hotspot
#   services.create_ap = {
#     enable = true;
#     settings = {
#       INTERNET_IFACE = "enp42s0f3u3";
#       WIFI_IFACE = "wlo1";
#       WPA_VERSION = "3";
#       FREQ_BAND = "2.4";
#       SSID = "FC-Kiffen";
#       PASSPHRASE = "ZA8r2dXB3KddEn";
#     };
#   };

  services.avahi.enable = true;
  services.avahi.nssmdns4 = true;

  # Enable sound with pipewire.
#   hardware.pulseaudio = {
#     enable = true;
#     extraConfig = "load-module module-equalizer-sink\nload-module module-dbus-protocol";
#   };
#   security.rtkit.enable = true;
  # By default, NixOS uses Pipewire. Below is the default setting
   services.pipewire = {
     enable = true;
     alsa.enable = true;
     alsa.support32Bit = true;
     pulse.enable = true;
#     extraConfig.pipewire =
#      {
#         "10-null-sink" = {
#           context.objects = [
#             { factory = "adapter";
#               args = {
#                 factory.name = "support.null-audio-sink";
#                 node.name = "my-sink";
#                 media.class = "Audio/Sink";
#                 audio.position = [ "FL" "FR" "FC" "LFE" "RL" "RR" ];
#                 monitor.channel-volumes = true;
#                 monitor.passthrough = true;
#                 adapter.auto-port-config = {
#                   mode = "dsp";
#                   monitor = true;
#                   position = "preserve";
#                 };
#               };
#             }
#           ];
#         };
#      };
    # If you want to use JACK applications, uncomment this
    #jack.enable = true;

    # use the example session manager (no others are packaged yet so this is enabled by default,
    # no need to redefine it in your config for now)
    #media-session.enable = true;
  };

  # TLP Power management
#   services.tlp = {
#     enable = true;
#     settings = {
#       CPU_SCALING_GOVERNOR_ON_BAT="performance";
#       CPU_SCALING_GOVERNOR_ON_AC="performance";
#
#       # 100 is max
#       CPU_MAX_PERF_ON_BAT=100;
#       CPU_MAX_PERF_ON_AC=100;
#     };
#   };

  # Enable touchpad support (enabled default in most desktopManager).
  # services.xserver.libinput.enable = true;

  users.groups.plugdev = {};

  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users.nika = {
    isNormalUser = true;
    description = "nika";
    extraGroups = [ "networkmanager" "wheel" "libvirtd" "wireshark" "openrazer" "scanner" "lp" "plugdev" ];
    packages = with pkgs; [
      kdePackages.kate
    #  thunderbird
    ];
  };

  services.davfs2.enable = true;

  services.samba.enable = true;

  #services.monero.enable = true;

#   services.xmrig = {
#     enable = true;
#     settings = {
#       autosave = true;
#       cpu = true;
#       opencl = false;
#       cuda = true;
#       pools = [
#         {
#           url = "pool.supportxmr.com:443";
#           user = "your-wallet";
#           keepalive = true;
#           tls = true;
#         }
#       ];
#     };
#   };

  # Install firefox.
  programs.firefox.enable = true;

  # Install Steam
  programs.steam = {
    enable = true;
    remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
    dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
  };

  # install git
  programs.git = {
    enable = true;
  };

  programs.wireshark = {
    enable = true;
  };

  programs.coolercontrol.enable = true;

  hardware.openrazer.enable = true;

  #nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
  #  "steam"
  #  "steam-original"
  #  "steam-run"
  #];

  # Allow unfree packages
  nixpkgs.config.allowUnfree = true;

  # libvirtdeez nuts AAAAAAAAAAAAaa
  virtualisation.libvirtd = {
    enable = true;
    qemu = {
      package = pkgs.qemu_kvm;
      runAsRoot = true;
      swtpm.enable = true;
      ovmf = {
        enable = true;
        packages = [(pkgs.OVMF.override {
          secureBoot = true;
          tpmSupport = true;
        }).fd];
      };
      vhostUserPackages = [
        pkgs.virtiofsd
      ];
    };
  };

  # Automatically delete generations older than 30 days every week
  nix.gc = {
    automatic = true;
    dates = "weekly";
    options = "--delete-older-than 30d";
  };

 # specialisation."VFIO".configuration = {
  #  system.nixos.tags = [ "with-vfio" ];
  # vfio.enable = true;
  #};

  # List packages installed in system profile. To search, run:
  # $ nix search wget
  environment.systemPackages =
    #let
    #  nvidiaEnabled = lib.elem "nvidia" config.services.xserver.videoDrivers;
    #in
    #(
    with pkgs; [
  #  vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
  #  wget
    librewolf
    lshw
    vlc
    wineWowPackages.stable
    winetricks
    gparted
    ntfs3g
    kdePackages.yakuake
    htop
    _1password-gui
    vencord
    spotify
    obs-studio
    cowsay
    kdePackages.kalarm
    nextcloud-client
    pciutils
    exfat
    wireshark
    exfatprogs
    cifs-utils
    kdePackages.kdenlive
    #glaxnimate
    hyfetch
    openrazer-daemon
    polychromatic
    libsForQt5.skanlite
    #gnome.simple-scan
    openrgb-with-all-plugins
    popsicle
    #libsForQt5.xp-pen-g430-driver
    krita
    #libsForQt5.xp-pen-deco-01-v2-driver
    tmuxPlugins.open
    screen
  # linux-wallpaperengine
    signal-desktop
    monero-gui
    qpaeq
    xmrig
    vesktop
    coolercontrol.coolercontrol-gui
    coolercontrol.coolercontrol-ui-data
    lm_sensors
    yt-dlp
    arduino
    usbutils
    audacity
    freerdp3
    remmina
    xclicker
    dotnetCorePackages.sdk_8_0_2xx
    icu
    vscode
    qdirstat
    kdePackages.kget
    #kdePackages.kcolorpicker
    #libsForQt5.kcolorpicker
    xcolor
    kdiskmark
    gsmartcontrol
    qpwgraph
    libreoffice
    esptool
    kdePackages.korganizer

    # QEMU stuff
    qemu
    virt-manager
    virt-viewer
    dnsmasq
    vde2
    bridge-utils
    netcat-openbsd
    libguestfs
    libvirt
  ];
  #)
  #++ lib.optionals nvidiaEnabled [
  #  (config.hardware.nvidia.package.settings.overrideAttrs (oldAttrs: {
  #    buildInputs = oldAttrs.buildInputs ++ [ pkgs.vulkan-headers ];
  #  }))
  #];



  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  # programs.mtr.enable = true;
  # programs.gnupg.agent = {
  #   enable = true;
  #   enableSSHSupport = true;
  # };

  # List services that you want to enable:

  # Enable the OpenSSH daemon.
  # services.openssh.enable = true;

  # Open ports in the firewall.
  # networking.firewall.allowedTCPPorts = [ ... ];
  # networking.firewall.allowedUDPPorts = [ ... ];
  # Or disable the firewall altogether.
  # networking.firewall.enable = false;

  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
  # on your system were taken. It‘s perfectly fine and recommended to leave
  # this value at the release version of the first install of this system.
  # Before changing this value read the documentation for this option
  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  system.stateVersion = "24.05"; # Did you read the comment?

  nix.settings.experimental-features = [ "nix-command" "flakes" ];
}

Trying 560 driver with overrideAttrs commented out yields:

building the system configuration...
error: builder for '/nix/store/y68lmsz4wwlv6sy4gwkknq3l3n94f4yc-nvidia-settings-560.35.03.drv' failed with exit code 2;
       last 10 log lines:
       > make[1]: *** [Makefile:381: _out/Linux_x86_64/gtk3/ctkevent.o] Error 1
       > In file included from gtk+-2.x/ctkwindow.h:25,
       >                  from gtk+-2.x/ctkwindow.c:34:
       > libXNVCtrlAttributes/NvCtrlAttributes.h:24:10: fatal error: vulkan/vulkan.h: No such file or directory
       >    24 | #include <vulkan/vulkan.h>
       >       |          ^~~~~~~~~~~~~~~~~
       > compilation terminated.
       > make[1]: *** [Makefile:381: _out/Linux_x86_64/gtk3/ctkwindow.o] Error 1
       > make[1]: Leaving directory '/build/source/src'
       > make: *** [Makefile:23: all] Error 2
       For full logs, run 'nix log /nix/store/y68lmsz4wwlv6sy4gwkknq3l3n94f4yc-nvidia-settings-560.35.03.drv'.
error: 1 dependencies of derivation '/nix/store/gii45ixirbr6a3hikvj1fy0xs5q7g5i2-unit-coolercontrold.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/29lv61ns2bbsji3xycj4adkcpgf4vvmj-system-units.drv' failed to build
error: 1 dependencies of derivation '/nix/store/by53vxfb32gja4n26aipipi29bql807s-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/x4x3dycz9s268vn6d5l2f4zb7mdvrlvn-nixos-system-nixos-24.05.20241004.6e6b3dd.drv' failed to build

Hello again, I’m returning with another error since vulkan header is still not implemented but the same 555.58.02 driver I’ve been using for a while is giving me this


I tried a newer driver hoping that the Vulkan header problem is already fixed but of course it’s not.

You probably should stick to an LTS kernel if you are using the proprietary nvidia drivers, as it’s not guaranteed that when NixOS bumps the latest kernel that those drivers will be able to compile against it.

It is fixed for all driver versions assuming you’re on 24.11: nvidia-settings: add vulkan-headers dependency · NixOS/nixpkgs@0384602 · GitHub

1 Like

After battling with upgrade from 24.05 to 24.11, everything works now.

Added hardware.graphics.enable = true and used the beta drivers.

I can use Wayland with Nvidia X settings and everything shows up. I think this will be the final post on this topic. Thank you everyone for help.

1 Like