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