Files

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

33 lines
655 B
Nix
Raw Permalink Normal View History

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