nixos/nvidia: allow the gsp to be toggled independently from open source driver
fixes #323886
This commit is contained in:
parent
20c5d0adfb
commit
ef3b6ad33d
@ -262,6 +262,14 @@ in
|
||||
lib.mkIf (lib.versionOlder config.hardware.nvidia.package.version "560") false
|
||||
'';
|
||||
};
|
||||
|
||||
gsp.enable = lib.mkEnableOption ''
|
||||
the GPU System Processor (GSP) on the video card
|
||||
'' // {
|
||||
defaultText = lib.literalExpression ''
|
||||
config.hardware.nvidia.open || lib.versionAtLeast config.hardware.nvidia.package.version "555"
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -312,6 +320,7 @@ in
|
||||
environment.systemPackages = [ nvidia_x11.bin ];
|
||||
|
||||
hardware.nvidia.open = lib.mkIf (lib.versionOlder nvidia_x11.version "560") (lib.mkDefault false);
|
||||
hardware.nvidia.gsp.enable = lib.mkDefault (cfg.open || lib.versionAtLeast nvidia_x11.version "555");
|
||||
})
|
||||
|
||||
# X11
|
||||
@ -370,8 +379,18 @@ in
|
||||
}
|
||||
|
||||
{
|
||||
assertion = cfg.open -> (cfg.package ? open && cfg.package ? firmware);
|
||||
message = "This version of NVIDIA driver does not provide a corresponding opensource kernel driver";
|
||||
assertion = cfg.gsp.enable -> (cfg.package ? firmware);
|
||||
message = "This version of NVIDIA driver does not provide a GSP firmware.";
|
||||
}
|
||||
|
||||
{
|
||||
assertion = cfg.open -> (cfg.package ? open);
|
||||
message = "This version of NVIDIA driver does not provide a corresponding opensource kernel driver.";
|
||||
}
|
||||
|
||||
{
|
||||
assertion = cfg.open -> cfg.gsp.enable;
|
||||
message = "The GSP cannot be disabled when using the opensource kernel driver.";
|
||||
}
|
||||
|
||||
{
|
||||
@ -558,7 +577,7 @@ in
|
||||
|
||||
services.dbus.packages = lib.optional cfg.dynamicBoost.enable nvidia_x11.bin;
|
||||
|
||||
hardware.firmware = lib.optional (cfg.open || lib.versionAtLeast nvidia_x11.version "555") nvidia_x11.firmware;
|
||||
hardware.firmware = lib.optional cfg.gsp.enable nvidia_x11.firmware;
|
||||
|
||||
systemd.tmpfiles.rules =
|
||||
[
|
||||
|
Loading…
Reference in New Issue
Block a user