about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@users.noreply.github.com>2019-05-03 10:31:11 -0400
committerGitHub <noreply@github.com>2019-05-03 10:31:11 -0400
commita01943c7f0961aabd01621e1b8221446510c26fa (patch)
tree284b34fa44f72bf1e5d135124b8c87a31a5e68c3 /nixos
parentdaf1010117ab21e49066470b5b5fb75fca368f74 (diff)
parentd67494972d1b59b1992031aebeb27e07c1520da9 (diff)
Merge pull request #59856 from c00w/external_gpu
nixos/nvidia: Add NVIDIA optimus option to allow external GPUs 
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/hardware/video/nvidia.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/nixos/modules/hardware/video/nvidia.nix b/nixos/modules/hardware/video/nvidia.nix
index 80ea7bc5d5c95..9f2360f41c6eb 100644
--- a/nixos/modules/hardware/video/nvidia.nix
+++ b/nixos/modules/hardware/video/nvidia.nix
@@ -79,6 +79,14 @@ in
       '';
     };
 
+    hardware.nvidia.optimus_prime.allowExternalGpu = lib.mkOption {
+      type = lib.types.bool;
+      default = false;
+      description = ''
+        Configure X to allow external NVIDIA GPUs when using optimus.
+      '';
+    };
+
     hardware.nvidia.optimus_prime.nvidiaBusId = lib.mkOption {
       type = lib.types.string;
       default = "";
@@ -134,6 +142,7 @@ in
       deviceSection = optionalString optimusCfg.enable
         ''
           BusID "${optimusCfg.nvidiaBusId}"
+          ${optionalString optimusCfg.allowExternalGpu "Option \"AllowExternalGpus\""}
         '';
       screenSection =
         ''