2014-04-14 15:26:48 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
2012-03-17 17:26:17 +00:00
|
|
|
|
2014-04-14 15:26:48 +01:00
|
|
|
with lib;
|
2012-02-22 20:28:44 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
2012-03-17 17:26:17 +00:00
|
|
|
hardware.cpu.intel.updateMicrocode = mkOption {
|
2012-02-22 20:28:44 +00:00
|
|
|
default = false;
|
2012-03-17 17:26:17 +00:00
|
|
|
type = types.bool;
|
2022-07-28 22:19:15 +01:00
|
|
|
description = lib.mdDoc ''
|
2012-03-17 17:26:17 +00:00
|
|
|
Update the CPU microcode for Intel processors.
|
2012-02-22 20:28:44 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
2012-03-17 17:26:17 +00:00
|
|
|
config = mkIf config.hardware.cpu.intel.updateMicrocode {
|
2017-02-27 16:12:33 +00:00
|
|
|
# Microcode updates must be the first item prepended in the initrd
|
|
|
|
boot.initrd.prepend = mkOrder 1 [ "${pkgs.microcodeIntel}/intel-ucode.img" ];
|
2012-02-22 20:28:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|