# RTX 3080 Ti with the open kernel module, as linux-cachyos-nvidia-open on # CachyOS. Turned off in the test VM (see vm.nix). { config, lib, pkgs, ... }: let cfg = config.dot.nvidia; # The driver CachyOS runs: 615.78.08. The kernel's package set comes from the # nixpkgs the CachyOS kernel flake pins (cachyos.nix), which can be a driver # release behind the system's nixpkgs. Then the driver is built from the # system nixpkgs' definition instead (pkgs/os-specific/linux/nvidia-x11), # against the same kernel. Once the pinned set catches up, its own driver is # used again and this can go. pinnedDriver = config.boot.kernelPackages.nvidiaPackages.latest; nvidiaDriver = if lib.versionAtLeast pinnedDriver.version "615.78.08" then pinnedDriver else config.boot.kernelPackages.nvidiaPackages.mkDriver { version = "615.78.08"; sha256_64bit = "sha256-Pj9t3cLudnoIGFMAr3vjyyhuznZpjS3eNSRZl4LQf/4="; sha256_aarch64 = "sha256-UHYBE1AYHoGgMfD9AS/jX+S+N8eCDWUft6qolK9Eejc="; openSha256 = "sha256-HBINiOjL0ZJLIAJeNIBYHBnwgUXtNwPPtnFpAI1YwF4="; settingsSha256 = "sha256-inDRpG02sdDgHmlqgu/DsgK8OFdOt1fZIYyXdhlGC/c="; persistencedSha256 = "sha256-RzeR6Ldct6MUxjnXRyThdh5Y3jjMehTVg85MtwuWNX4="; }; in { options.dot.nvidia.enable = lib.mkEnableOption "the NVIDIA driver" // { default = true; }; config = lib.mkMerge [ { hardware.graphics = { enable = true; enable32Bit = true; }; } (lib.mkIf cfg.enable { services.xserver.videoDrivers = [ "nvidia" ]; hardware.nvidia = { open = true; package = nvidiaDriver; modesetting.enable = true; nvidiaSettings = true; # Not set up on CachyOS either (no nvidia-suspend services enabled). powerManagement.enable = false; }; # libva-nvidia-driver: Firefox hardware video decoding (see the NVD_BACKEND # and LIBVA_DRIVER_NAME lines in hyprland.lua). hardware.graphics.extraPackages = [ pkgs.nvidia-vaapi-driver ]; }) ]; }