diff --git a/modules/hardware/nvidia/default.nix b/modules/hardware/nvidia/default.nix index 1c563375..9a13f7e6 100644 --- a/modules/hardware/nvidia/default.nix +++ b/modules/hardware/nvidia/default.nix @@ -15,15 +15,6 @@ in { ]; options.modules.hardware.nvidia = { enable = mkEnableOption false; - prime.enable = mkEnableOption false; - prime.intelBusId = mkOption { - type = busIDType; - default = ""; - }; - prime.nvidiaBusId = mkOption { - type = busIDType; - default = ""; - }; }; config = mkIf cfg.enable { @@ -56,18 +47,6 @@ in { # Package package = config.boot.kernelPackages.nvidiaPackages.stable; - - # TODO(sako) ALSO add these as a cfg option - prime = { - offload = { - enable = cfg.prime; - enableOffloadCmd = cfg.prime; - }; - #intelBusId = "PCI:0:2:0"; - #nvidiaBusId = "PCI:1:0:0"; - intelBusId = cfg.intelBusId; - nvidiaBusId = cfg.nvidiaBusId; - }; }; }; } diff --git a/modules/hardware/nvidia/prime.nix b/modules/hardware/nvidia/prime.nix index 5899e892..eb47491f 100644 --- a/modules/hardware/nvidia/prime.nix +++ b/modules/hardware/nvidia/prime.nix @@ -7,11 +7,14 @@ ... }: with lib; let - cfg = config.modules.hardware.nvidia; + cfg = config.modules.hardware.nvidia.prime; busIDType = lib.types.strMatching "([[:print:]]+[\:\@][0-9]{1,3}\:[0-9]{1,2}\:[0-9])?"; in { options.modules.hardware.nvidia.prime = { - enable = mkEnableOption false; + enable = mkOption { + type = types.bool; + default = false; + }; intelBusId = mkOption { type = busIDType; default = ""; @@ -26,8 +29,8 @@ in { hardware.nvidia = { prime = { offload = { - enable = cfg.prime; - enableOffloadCmd = cfg.prime; + enable = cfg.enable; + enableOffloadCmd = cfg.enable; }; #intelBusId = "PCI:0:2:0"; #nvidiaBusId = "PCI:1:0:0";