mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-26 23:54:01 +00:00
35 lines
654 B
Nix
35 lines
654 B
Nix
|
{pkgs, config, ...}:
|
||
|
|
||
|
{
|
||
|
|
||
|
###### interface
|
||
|
|
||
|
options = {
|
||
|
|
||
|
hardware.cpu.intel.updateMicrocode = pkgs.lib.mkOption {
|
||
|
default = false;
|
||
|
type = pkgs.lib.types.bool;
|
||
|
description = ''
|
||
|
Update the CPU microcode for intel processors.
|
||
|
'';
|
||
|
};
|
||
|
|
||
|
};
|
||
|
|
||
|
|
||
|
###### implementation
|
||
|
|
||
|
config = pkgs.lib.mkIf config.hardware.cpu.intel.updateMicrocode {
|
||
|
hardware.firmware = [pkgs.microcodeIntel];
|
||
|
jobs.microcode = {
|
||
|
name = "microcode";
|
||
|
description = "load microcode";
|
||
|
startOn = "started udev";
|
||
|
exec = "modprobe microcode";
|
||
|
path = [config.system.sbin.modprobe];
|
||
|
task = true;
|
||
|
};
|
||
|
};
|
||
|
|
||
|
}
|