1{ config, lib, pkgs, ... }:
2
3with lib;
4
5{
6
7 ###### interface
8
9 options = {
10
11 hardware.cpu.amd.updateMicrocode = mkOption {
12 default = false;
13 type = types.bool;
14 description = ''
15 Update the CPU microcode for AMD processors.
16 '';
17 };
18
19 };
20
21
22 ###### implementation
23
24 config = mkIf config.hardware.cpu.amd.updateMicrocode {
25 # Microcode updates must be the first item prepended in the initrd
26 boot.initrd.prepend = mkOrder 1 [ "${pkgs.microcodeAmd}/amd-ucode.img" ];
27 };
28
29}