From 29e0b383ab03e4f6efac02e4fc2db267e9e8e92e Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Wed, 14 Aug 2024 11:07:14 +0200 Subject: [PATCH] nixos-modules/hwCommon: rename x-banananetwork.hwCommon.cpu -> hardware.cpu.type --- nix/nixos-modules/hwCommon.nix | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/nix/nixos-modules/hwCommon.nix b/nix/nixos-modules/hwCommon.nix index 37eaa60..681b86d 100644 --- a/nix/nixos-modules/hwCommon.nix +++ b/nix/nixos-modules/hwCommon.nix @@ -7,19 +7,17 @@ }: let cfg = config.x-banananetwork.hwCommon; + cpu = config.hardware.cpu; in { options = { - x-banananetwork.hwCommon = { - enable = lib.mkEnableOption '' - settings common to all bare hardware-based hosts - ''; + hardware.cpu = { - cpu = lib.mkOption { + type = lib.mkOption { description = '' Configures the CPU type to expect this configuration to run on ''; @@ -29,6 +27,16 @@ in }; + + x-banananetwork.hwCommon = { + + enable = lib.mkEnableOption '' + settings common to all bare hardware-based hosts + ''; + + }; + + }; @@ -41,13 +49,13 @@ in ( lib.mkIf - (cfg.cpu == "amd") + (cpu.type == "amd") { amd.updateMicrocode = true; } ) ( lib.mkIf - (cfg.cpu == "intel") + (cpu.type == "intel") { intel.updateMicrocode = true; } )