nixos/nvidia: let user choose whether to install nvidia-settings

This commit is contained in:
Bernardo Meurer 2021-08-30 16:23:57 -07:00
parent 197a496c7f
commit 7b2709f6a4
No known key found for this signature in database
GPG Key ID: F4C0D53B8D14C246

View File

@ -143,6 +143,15 @@ in
'';
};
hardware.nvidia.nvidiaSettings = mkOption {
default = true;
type = types.bool;
description = ''
Whether to add nvidia-settings, NVIDIA's GUI configuration tool, to
systemPackages.
'';
};
hardware.nvidia.nvidiaPersistenced = mkOption {
default = false;
type = types.bool;
@ -279,7 +288,8 @@ in
hardware.opengl.extraPackages = optional offloadCfg.enable nvidia_x11.out;
hardware.opengl.extraPackages32 = optional offloadCfg.enable nvidia_x11.lib32;
environment.systemPackages = [ nvidia_x11.bin nvidia_x11.settings ]
environment.systemPackages = [ nvidia_x11.bin ]
++ optionals nvidiaSettings [ nvidia_x11.settings ]
++ optionals nvidiaPersistencedEnabled [ nvidia_x11.persistenced ];
systemd.packages = optional cfg.powerManagement.enable nvidia_x11.out;