summary refs log blame commit diff
path: root/nixos/modules/hardware/cpu/amd-microcode.nix
blob: 621c7066bfe1b2dbca75651ae8daf9335a85070f (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
                           
 
         










                                                 
                                                    








                                                         

                                                                             


    
{ config, lib, pkgs, ... }:

with 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 {
    # Microcode updates must be the first item prepended in the initrd
    boot.initrd.prepend = mkOrder 1 [ "${pkgs.microcodeAmd}/amd-ucode.img" ];
  };

}