nixos/nvidia: remove lib references

This commit is contained in:
Edmund Wu 2019-08-13 22:39:26 -04:00
parent 38c7aa05ef
commit 5d21e8c92b
No known key found for this signature in database
GPG key ID: 76AA3F9F2BD3E3A0

View file

@ -39,8 +39,8 @@ in
{ {
options = { options = {
hardware.nvidia.modesetting.enable = lib.mkOption { hardware.nvidia.modesetting.enable = mkOption {
type = lib.types.bool; type = types.bool;
default = false; default = false;
description = '' description = ''
Enable kernel modesetting when using the NVIDIA proprietary driver. Enable kernel modesetting when using the NVIDIA proprietary driver.
@ -52,8 +52,8 @@ in
''; '';
}; };
hardware.nvidia.optimus_prime.enable = lib.mkOption { hardware.nvidia.optimus_prime.enable = mkOption {
type = lib.types.bool; type = types.bool;
default = false; default = false;
description = '' description = ''
Enable NVIDIA Optimus support using the NVIDIA proprietary driver via PRIME. Enable NVIDIA Optimus support using the NVIDIA proprietary driver via PRIME.
@ -79,16 +79,16 @@ in
''; '';
}; };
hardware.nvidia.optimus_prime.allowExternalGpu = lib.mkOption { hardware.nvidia.optimus_prime.allowExternalGpu = mkOption {
type = lib.types.bool; type = types.bool;
default = false; default = false;
description = '' description = ''
Configure X to allow external NVIDIA GPUs when using optimus. Configure X to allow external NVIDIA GPUs when using optimus.
''; '';
}; };
hardware.nvidia.optimus_prime.nvidiaBusId = lib.mkOption { hardware.nvidia.optimus_prime.nvidiaBusId = mkOption {
type = lib.types.str; type = types.str;
default = ""; default = "";
example = "PCI:1:0:0"; example = "PCI:1:0:0";
description = '' description = ''
@ -97,8 +97,8 @@ in
''; '';
}; };
hardware.nvidia.optimus_prime.intelBusId = lib.mkOption { hardware.nvidia.optimus_prime.intelBusId = mkOption {
type = lib.types.str; type = types.str;
default = ""; default = "";
example = "PCI:0:2:0"; example = "PCI:0:2:0";
description = '' description = ''
@ -179,7 +179,7 @@ in
hardware.opengl.package32 = nvidia_libs32; hardware.opengl.package32 = nvidia_libs32;
environment.systemPackages = [ nvidia_x11.bin nvidia_x11.settings ] environment.systemPackages = [ nvidia_x11.bin nvidia_x11.settings ]
++ lib.filter (p: p != null) [ nvidia_x11.persistenced ]; ++ filter (p: p != null) [ nvidia_x11.persistenced ];
systemd.tmpfiles.rules = optional config.virtualisation.docker.enableNvidia systemd.tmpfiles.rules = optional config.virtualisation.docker.enableNvidia
"L+ /run/nvidia-docker/bin - - - - ${nvidia_x11.bin}/origBin" "L+ /run/nvidia-docker/bin - - - - ${nvidia_x11.bin}/origBin"
@ -190,7 +190,7 @@ in
# nvidia-uvm is required by CUDA applications. # nvidia-uvm is required by CUDA applications.
boot.kernelModules = [ "nvidia-uvm" ] ++ boot.kernelModules = [ "nvidia-uvm" ] ++
lib.optionals config.services.xserver.enable [ "nvidia" "nvidia_modeset" "nvidia_drm" ]; optionals config.services.xserver.enable [ "nvidia" "nvidia_modeset" "nvidia_drm" ];
# If requested enable modesetting via kernel parameter. # If requested enable modesetting via kernel parameter.
boot.kernelParams = optional cfg.modesetting.enable "nvidia-drm.modeset=1"; boot.kernelParams = optional cfg.modesetting.enable "nvidia-drm.modeset=1";