blob: 8bf29232003cd6495cebe758ba9540c769721f0c (
plain) (
tree)
|
|
{
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"];
})
]);
}
|