copy a little from nixpkgs/nixos

This commit is contained in:
Sakooooo 2023-08-13 19:27:13 +03:00
parent 26620cc535
commit f90c10441b
Signed by: sako
GPG key ID: 3FD715D87D7725E0

View file

@ -8,17 +8,18 @@
}: }:
with lib; let with lib; let
cfg = config.modules.hardware.nvidia; cfg = config.modules.hardware.nvidia;
busIDType = lib.types.strMatching "([[:print:]]+[\:\@][0-9]{1,3}\:[0-9]{1,2}\:[0-9])?";
in { in {
options.modules.hardware.nvidia = { options.modules.hardware.nvidia = {
enable = mkEnableOption false; enable = mkEnableOption false;
prime.enable = mkEnableOption false; prime.enable = mkEnableOption false;
prime.intelBusID = mkOption { prime.intelBusID = mkOption {
type = types.str; type = busIDType;
default = null; default = "";
}; };
prime.nvidiaBusId = mkOption { prime.nvidiaBusId = mkOption {
type = types.str; type = busIDType;
default = null; default = "";
}; };
}; };