summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorGuillaume Girol <symphorien+git@xlumurb.eu>2022-04-17 12:00:00 +0000
committerGuillaume Girol <symphorien+git@xlumurb.eu>2022-04-17 12:00:00 +0000
commit5f95bff4812281609d75af940376b10ba181d7ce (patch)
tree22af60603a334d1d358243d6da3cd681f40be3b8 /nixos/modules
parent0cf4c16b9b763c9951b77015aa0765c8a5b0e06f (diff)
downloadnixpkgs-5f95bff4812281609d75af940376b10ba181d7ce.tar
nixpkgs-5f95bff4812281609d75af940376b10ba181d7ce.tar.gz
nixpkgs-5f95bff4812281609d75af940376b10ba181d7ce.tar.bz2
nixpkgs-5f95bff4812281609d75af940376b10ba181d7ce.tar.lz
nixpkgs-5f95bff4812281609d75af940376b10ba181d7ce.tar.xz
nixpkgs-5f95bff4812281609d75af940376b10ba181d7ce.tar.zst
nixpkgs-5f95bff4812281609d75af940376b10ba181d7ce.zip
nixos/nvidia: fix type of bus ID option to accept empty string
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/hardware/video/nvidia.nix7
1 files changed, 4 insertions, 3 deletions
diff --git a/nixos/modules/hardware/video/nvidia.nix b/nixos/modules/hardware/video/nvidia.nix
index c7c440bea19..6899eb4e196 100644
--- a/nixos/modules/hardware/video/nvidia.nix
+++ b/nixos/modules/hardware/video/nvidia.nix
@@ -24,6 +24,7 @@ let
   primeEnabled = syncCfg.enable || offloadCfg.enable;
   nvidiaPersistencedEnabled =  cfg.nvidiaPersistenced;
   nvidiaSettings = cfg.nvidiaSettings;
+  busIDType = types.strMatching "([[:print:]]+\:[0-9]{1,3}\:[0-9]{1,2}\:[0-9])?";
 in
 
 {
@@ -68,7 +69,7 @@ in
     };
 
     hardware.nvidia.prime.nvidiaBusId = mkOption {
-      type = types.strMatching "[[:print:]]+\:[0-9]{1,3}\:[0-9]{1,2}\:[0-9]";
+      type = busIDType;
       default = "";
       example = "PCI:1:0:0";
       description = ''
@@ -78,7 +79,7 @@ in
     };
 
     hardware.nvidia.prime.intelBusId = mkOption {
-      type = types.strMatching "[[:print:]]+\:[0-9]{1,3}\:[0-9]{1,2}\:[0-9]";
+      type = busIDType;
       default = "";
       example = "PCI:0:2:0";
       description = ''
@@ -88,7 +89,7 @@ in
     };
 
     hardware.nvidia.prime.amdgpuBusId = mkOption {
-      type = types.strMatching "[[:print:]]+\:[0-9]{1,3}\:[0-9]{1,2}\:[0-9]";
+      type = busIDType;
       default = "";
       example = "PCI:4:0:0";
       description = ''