diff options
Diffstat (limited to 'nixos/modules/hardware/cpu/amd-microcode.nix')
-rw-r--r-- | nixos/modules/hardware/cpu/amd-microcode.nix | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/nixos/modules/hardware/cpu/amd-microcode.nix b/nixos/modules/hardware/cpu/amd-microcode.nix new file mode 100644 index 000000000000..5720a63834f5 --- /dev/null +++ b/nixos/modules/hardware/cpu/amd-microcode.nix @@ -0,0 +1,29 @@ +{ config, pkgs, ... }: + +with pkgs.lib; + +{ + + ###### interface + + options = { + + hardware.cpu.amd.updateMicrocode = mkOption { + default = false; + type = types.bool; + description = '' + Update the CPU microcode for AMD processors. + ''; + }; + + }; + + + ###### implementation + + config = mkIf config.hardware.cpu.amd.updateMicrocode { + hardware.firmware = [ "${pkgs.amdUcode}/lib/firmware" ]; + boot.kernelModules = [ "microcode" ]; + }; + +} |