diff --git a/machines/playman/hardware-configuration.nix b/machines/playman/hardware-configuration.nix index 4f63519..39d5775 100644 --- a/machines/playman/hardware-configuration.nix +++ b/machines/playman/hardware-configuration.nix @@ -2,9 +2,6 @@ pkgs, ... }: -let - cpuFlavor = "intel"; -in { boot.kernelPackages = pkgs.linuxPackages_latest; @@ -17,11 +14,11 @@ in }; firmware = { enable = true; - inherit cpuFlavor; + cpuFlavor = "intel"; }; graphics = { enable = true; - inherit cpuFlavor; + gpuFlavor = "nvidia"; }; keychron.enable = true; yubikey.enable = true; diff --git a/machines/thinkman/hardware-configuration.nix b/machines/thinkman/hardware-configuration.nix index af5463d..0727182 100644 --- a/machines/thinkman/hardware-configuration.nix +++ b/machines/thinkman/hardware-configuration.nix @@ -1,8 +1,4 @@ -_: -let - cpuFlavor = "intel"; -in -{ +_: { # video driver boot.initrd.kernelModules = [ "i915" ]; @@ -20,11 +16,11 @@ in drive-monitor.enable = true; firmware = { enable = true; - inherit cpuFlavor; + cpuFlavor = "intel"; }; graphics = { enable = true; - inherit cpuFlavor; + gpuFlavor = "intel"; }; id-card.enable = true; keychron.enable = true; diff --git a/machines/workman/hardware-configuration.nix b/machines/workman/hardware-configuration.nix index b15c33b..6cd67f1 100644 --- a/machines/workman/hardware-configuration.nix +++ b/machines/workman/hardware-configuration.nix @@ -2,9 +2,6 @@ pkgs, ... }: -let - cpuFlavor = "amd"; -in { boot.kernelPackages = pkgs.linuxPackages_latest; @@ -30,11 +27,11 @@ in drive-monitor.enable = true; firmware = { enable = true; - inherit cpuFlavor; + cpuFlavor = "amd"; }; graphics = { enable = true; - inherit cpuFlavor; + gpuFlavor = "amd"; }; id-card.enable = true; keychron.enable = true; diff --git a/modules/hardware/graphics/default.nix b/modules/hardware/graphics/default.nix index 4f9befe..4608559 100644 --- a/modules/hardware/graphics/default.nix +++ b/modules/hardware/graphics/default.nix @@ -10,11 +10,12 @@ in { options.my.hardware.graphics = { enable = lib.mkEnableOption "graphics configuration"; - cpuFlavor = lib.mkOption { + gpuFlavor = lib.mkOption { type = lib.types.nullOr ( lib.types.enum [ "amd" "intel" + "nvidia" ] ); default = null; @@ -29,7 +30,7 @@ in hardware.graphics.enable = true; } # Intel GPU - (lib.mkIf (cfg.cpuFlavor == "intel") { + (lib.mkIf (cfg.gpuFlavor == "intel") { nixpkgs.config.packageOverrides = pkgs: { intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; }; }; @@ -41,7 +42,9 @@ in ]; }) - (lib.mkIf (cfg.cpuFlavor == "amd") { + (lib.mkIf (cfg.gpuFlavor == "amd") { + }) + (lib.mkIf (cfg.gpuFlavor == "nvidia") { }) ] );