2012-03-17 17:26:17 +00:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
with pkgs.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;
|
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
|
|
|
|
|
2012-03-17 17:26:17 +00:00
|
|
|
config = mkIf config.hardware.cpu.intel.updateMicrocode {
|
|
|
|
hardware.firmware = [ pkgs.microcodeIntel ];
|
2012-03-18 08:10:32 +00:00
|
|
|
|
|
|
|
# This cannot be done using boot.kernelModules
|
|
|
|
# discussion at http://lists.science.uu.nl/pipermail/nix-dev/2012-February/007959.html
|
|
|
|
jobs.microcode = {
|
|
|
|
name = "microcode";
|
|
|
|
description = "load microcode";
|
|
|
|
startOn = "started udev";
|
|
|
|
exec = "modprobe microcode";
|
|
|
|
path = [config.system.sbin.modprobe];
|
|
|
|
task = true;
|
|
|
|
};
|
2012-02-22 20:28:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|