From daec6e3754620e8b0a4436ce7cc7fefc380c9e65 Mon Sep 17 00:00:00 2001 From: Acid Bong Date: Fri, 14 Nov 2025 14:35:19 +0200 Subject: [PATCH] nixos/cpu/intel: allow customizing microcode package follow-up to #434472 --- nixos/modules/hardware/cpu/intel-microcode.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nixos/modules/hardware/cpu/intel-microcode.nix b/nixos/modules/hardware/cpu/intel-microcode.nix index 02eeed7695b8..53a5f1a1dc82 100644 --- a/nixos/modules/hardware/cpu/intel-microcode.nix +++ b/nixos/modules/hardware/cpu/intel-microcode.nix @@ -4,6 +4,9 @@ pkgs, ... }: +let + cfg = config.hardware.cpu.intel; +in { ###### interface options = { @@ -15,13 +18,13 @@ Update the CPU microcode for Intel processors. ''; }; - + hardware.cpu.intel.microcodePackage = lib.mkPackageOption pkgs "microcode-intel" { }; }; ###### implementation - config = lib.mkIf config.hardware.cpu.intel.updateMicrocode { + config = lib.mkIf cfg.updateMicrocode { # Microcode updates must be the first item prepended in the initrd - boot.initrd.prepend = lib.mkOrder 1 [ "${pkgs.microcode-intel}/intel-ucode.img" ]; + boot.initrd.prepend = lib.mkOrder 1 [ "${cfg.microcodePackage}/intel-ucode.img" ]; }; }