summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorColin L Rice <colin@daedrum.net>2019-04-18 18:51:35 -0400
committerColin L Rice <colin@daedrum.net>2019-05-02 23:57:28 -0400
commitd67494972d1b59b1992031aebeb27e07c1520da9 (patch)
tree97d85986c74b4a75af8bacdfca9adc5526514181 /nixos
parentcdf234714b6fad65ecd56da20e1cab6681772ed5 (diff)
downloadnixpkgs-d67494972d1b59b1992031aebeb27e07c1520da9.tar
nixpkgs-d67494972d1b59b1992031aebeb27e07c1520da9.tar.gz
nixpkgs-d67494972d1b59b1992031aebeb27e07c1520da9.tar.bz2
nixpkgs-d67494972d1b59b1992031aebeb27e07c1520da9.tar.lz
nixpkgs-d67494972d1b59b1992031aebeb27e07c1520da9.tar.xz
nixpkgs-d67494972d1b59b1992031aebeb27e07c1520da9.tar.zst
nixpkgs-d67494972d1b59b1992031aebeb27e07c1520da9.zip
nixos/nvidia: Add NVIDIA optimus option to allow external GPUs
Without this option - NVIDIA refuses to use an external GPU.
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 80ea7bc5d5c..9f2360f41c6 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 =
         ''