From ad65e807bd2870f64b3eb7137f1140a827732897 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Tue, 11 Sep 2012 18:44:37 +0200 Subject: [PATCH] Add new 'hardware.cpu.amd.updateMicrocode' option. --- modules/hardware/cpu/amd-microcode.nix | 29 ++++++++++++++++++++++++++ modules/module-list.nix | 1 + 2 files changed, 30 insertions(+) create mode 100644 modules/hardware/cpu/amd-microcode.nix diff --git a/modules/hardware/cpu/amd-microcode.nix b/modules/hardware/cpu/amd-microcode.nix new file mode 100644 index 00000000000..2b224e04f2d --- /dev/null +++ b/modules/hardware/cpu/amd-microcode.nix @@ -0,0 +1,29 @@ +{ config, pkgs, ... }: + +with pkgs.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 ]; + boot.kernelModules = [ "microcode" ]; + }; + +} diff --git a/modules/module-list.nix b/modules/module-list.nix index 08927d747ff..1d40a4145ae 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -16,6 +16,7 @@ ./config/users-groups.nix ./hardware/all-firmware.nix ./hardware/cpu/intel-microcode.nix + ./hardware/cpu/amd-microcode.nix ./hardware/network/b43.nix ./hardware/network/intel-2100bg.nix ./hardware/network/intel-2200bg.nix