summary refs log tree commit diff
path: root/nixos/modules/hardware/cpu/amd-microcode.nix
blob: 86a3df5da21dc484f3e00e6c511f34998bd6bedc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{ 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 {
    hardware.firmware = [ "${pkgs.amdUcode}/lib/firmware" ];
    boot.kernelModules = [ "microcode" ];
  };

}