From f90c10441b3b6e8715dff2c6873fb2c0bd9f24ba Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 13 Aug 2023 19:27:13 +0300 Subject: [PATCH] copy a little from nixpkgs/nixos --- modules/hardware/nvidia/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/hardware/nvidia/default.nix b/modules/hardware/nvidia/default.nix index 7f7eaab1..1089c6e0 100644 --- a/modules/hardware/nvidia/default.nix +++ b/modules/hardware/nvidia/default.nix @@ -8,17 +8,18 @@ }: with lib; let cfg = config.modules.hardware.nvidia; + busIDType = lib.types.strMatching "([[:print:]]+[\:\@][0-9]{1,3}\:[0-9]{1,2}\:[0-9])?"; in { options.modules.hardware.nvidia = { enable = mkEnableOption false; prime.enable = mkEnableOption false; prime.intelBusID = mkOption { - type = types.str; - default = null; + type = busIDType; + default = ""; }; prime.nvidiaBusId = mkOption { - type = types.str; - default = null; + type = busIDType; + default = ""; }; };