Skip to content

Commit

Permalink
nixos/nvidia: make the nvidia driver variant a mandatory user choice
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiskae committed Aug 25, 2024
1 parent 8b52dae commit 20c5d0a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2411.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@
Processes also now run as a dynamically allocated user by default instead of
root.

- The nvidia driver no longer defaults to the proprietary driver starting with version 560. You will need to manually set `hardware.nvidia.open` to select the proprietary or open driver.

- `singularity-tools` have the `storeDir` argument removed from its override interface and use `builtins.storeDir` instead.

- Two build helpers in `singularity-tools`, i.e., `mkLayer` and `shellScript`, are deprecated, as they are no longer involved in image-building. Maintainers will remove them in future releases.
Expand Down
13 changes: 8 additions & 5 deletions nixos/modules/hardware/video/nvidia.nix
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,13 @@ in
'';
};

open = lib.mkEnableOption ''
the open source NVIDIA kernel module
'' // {
defaultText = lib.literalExpression ''lib.versionAtLeast config.hardware.nvidia.package.version "560"'';
open = lib.mkOption {
example = true;
description = "Whether to enable the open source NVIDIA kernel module.";
type = lib.types.bool;
defaultText = lib.literalExpression ''
lib.mkIf (lib.versionOlder config.hardware.nvidia.package.version "560") false
'';
};
};
};
Expand Down Expand Up @@ -308,7 +311,7 @@ in
};
environment.systemPackages = [ nvidia_x11.bin ];

hardware.nvidia.open = lib.mkDefault (lib.versionAtLeast nvidia_x11.version "560");
hardware.nvidia.open = lib.mkIf (lib.versionOlder nvidia_x11.version "560") (lib.mkDefault false);
})

# X11
Expand Down

0 comments on commit 20c5d0a

Please sign in to comment.