diff options
author | Jon Santmyer <jon@jonsantmyer.com> | 2024-01-07 12:00:08 -0500 |
---|---|---|
committer | Jon Santmyer <jon@jonsantmyer.com> | 2024-01-07 12:00:08 -0500 |
commit | 7b79203f54853733d4fae88943829d0e24e6e49f (patch) | |
tree | a352d199fad7453332b9308a6295164157729f27 /modules/hardware/cpu.nix | |
parent | 184bd30bcb303104a4981ac742d8f8961c5477e7 (diff) | |
download | nix-config-7b79203f54853733d4fae88943829d0e24e6e49f.tar.gz nix-config-7b79203f54853733d4fae88943829d0e24e6e49f.tar.bz2 nix-config-7b79203f54853733d4fae88943829d0e24e6e49f.zip |
massive overhaul
Diffstat (limited to 'modules/hardware/cpu.nix')
-rw-r--r-- | modules/hardware/cpu.nix | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/modules/hardware/cpu.nix b/modules/hardware/cpu.nix new file mode 100644 index 0000000..8bf2923 --- /dev/null +++ b/modules/hardware/cpu.nix @@ -0,0 +1,27 @@ +{ + config, + options, + lib, + ... +}: let + cpuConfig = config.modules.hardware.cpu; + device = config.modules.device; +in { + options.modules.hardware.cpu = { + enable = lib.mkOption { + type = lib.types.bool; + default = true; + }; + }; + + config = lib.mkIf (cpuConfig.enable) (lib.mkMerge [ + { + hardware.enableRedistributableFirmware = true; + environment.systemPackages = [config.boot.kernelPackages.cpupower]; + } + (lib.mkIf (device.cpu == "intel") { + hardware.cpu.intel.updateMicrocode = true; + boot.kernelModules = ["kvm-intel"]; + }) + ]); +} |