nixpkgs/nixos/modules/hardware/cpu/amd-microcode.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
526 B
Nix
Raw Normal View History

{
config,
lib,
pkgs,
...
}:
{
###### interface
options = {
hardware.cpu.amd.updateMicrocode = lib.mkOption {
default = false;
type = lib.types.bool;
description = ''
Update the CPU microcode for AMD processors.
'';
};
};
###### implementation
config = lib.mkIf config.hardware.cpu.amd.updateMicrocode {
# Microcode updates must be the first item prepended in the initrd
2024-09-08 15:15:12 +08:00
boot.initrd.prepend = lib.mkOrder 1 [ "${pkgs.microcode-amd}/amd-ucode.img" ];
};
}