summary refs log tree commit diff
path: root/nixos/modules/hardware
diff options
context:
space:
mode:
authorEdward Tjörnhammar <ed@cflags.cc>2023-09-13 17:59:45 +0200
committerEdward Tjörnhammar <ed@cflags.cc>2023-09-14 18:19:15 +0200
commit903ebdc0a053a202fceb5de9d8a3cd5cf85e04a1 (patch)
tree3cf651be0baabecb15dbf123bf4dc3cf31448226 /nixos/modules/hardware
parent52351762b78ee829c333afbaee47d8b8d3a73b56 (diff)
downloadnixpkgs-903ebdc0a053a202fceb5de9d8a3cd5cf85e04a1.tar
nixpkgs-903ebdc0a053a202fceb5de9d8a3cd5cf85e04a1.tar.gz
nixpkgs-903ebdc0a053a202fceb5de9d8a3cd5cf85e04a1.tar.bz2
nixpkgs-903ebdc0a053a202fceb5de9d8a3cd5cf85e04a1.tar.lz
nixpkgs-903ebdc0a053a202fceb5de9d8a3cd5cf85e04a1.tar.xz
nixpkgs-903ebdc0a053a202fceb5de9d8a3cd5cf85e04a1.tar.zst
nixpkgs-903ebdc0a053a202fceb5de9d8a3cd5cf85e04a1.zip
nixos/nvidia: don't assume x11 is used..
Diffstat (limited to 'nixos/modules/hardware')
-rw-r--r--nixos/modules/hardware/video/nvidia.nix9
1 files changed, 4 insertions, 5 deletions
diff --git a/nixos/modules/hardware/video/nvidia.nix b/nixos/modules/hardware/video/nvidia.nix
index 0b1238dd888..a40713ac25c 100644
--- a/nixos/modules/hardware/video/nvidia.nix
+++ b/nixos/modules/hardware/video/nvidia.nix
@@ -4,10 +4,9 @@
   pkgs,
   ...
 }: let
-  x11Enabled = config.services.xserver.enable
-               && (lib.elem "nvidia" config.services.xserver.videoDrivers);
+  nvidiaEnabled = (lib.elem "nvidia" config.services.xserver.videoDrivers);
   nvidia_x11 =
-    if  x11Enabled || cfg.datacenter.enable
+    if nvidiaEnabled || cfg.datacenter.enable
     then cfg.package
     else null;
 
@@ -256,7 +255,7 @@ in {
       ({
         assertions = [
           {
-            assertion = !(x11Enabled && cfg.datacenter.enable);
+            assertion = !(nvidiaEnabled && cfg.datacenter.enable);
             message = "You cannot configure both X11 and Data Center drivers at the same time.";
           }
         ];
@@ -289,7 +288,7 @@ in {
         ];
       })
       # X11
-      (lib.mkIf x11Enabled {
+      (lib.mkIf nvidiaEnabled {
         assertions = [
         {
           assertion = primeEnabled -> pCfg.intelBusId == "" || pCfg.amdgpuBusId == "";