aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/modules/hardware/cpu/amd-microcode.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/modules/hardware/cpu/amd-microcode.nix')
-rw-r--r--nixpkgs/nixos/modules/hardware/cpu/amd-microcode.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/nixpkgs/nixos/modules/hardware/cpu/amd-microcode.nix b/nixpkgs/nixos/modules/hardware/cpu/amd-microcode.nix
new file mode 100644
index 00000000000..621c7066bfe
--- /dev/null
+++ b/nixpkgs/nixos/modules/hardware/cpu/amd-microcode.nix
@@ -0,0 +1,29 @@
+{ config, lib, pkgs, ... }:
+
+with 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 {
+ # Microcode updates must be the first item prepended in the initrd
+ boot.initrd.prepend = mkOrder 1 [ "${pkgs.microcodeAmd}/amd-ucode.img" ];
+ };
+
+}