diff --git a/common/boot/bios.nix b/common/boot/bios.nix index 2b3670a..042a30b 100644 --- a/common/boot/bios.nix +++ b/common/boot/bios.nix @@ -12,6 +12,8 @@ in { }; config = mkIf cfg.enable { + # Enable microcode + firmware.x86_64 = true; # Use GRUB 2 for BIOS boot.loader = { timeout = 2; diff --git a/common/boot/efi.nix b/common/boot/efi.nix index 60fd64b..1042d50 100644 --- a/common/boot/efi.nix +++ b/common/boot/efi.nix @@ -9,6 +9,8 @@ in { }; config = mkIf cfg.enable { + # Enable microcode + firmware.x86_64 = true; # Use GRUB2 for EFI boot.loader = { efi.canTouchEfiVariables = true; diff --git a/common/boot/firmware.nix b/common/boot/firmware.nix index 08c16ef..b99c0dd 100644 --- a/common/boot/firmware.nix +++ b/common/boot/firmware.nix @@ -1,7 +1,17 @@ -{ config, pkgs, ... }: +{ lib, config, pkgs, ... }: -{ - hardware.cpu.intel.updateMicrocode = true; +with lib; +let + cfg = config.firmware; +in { + options.firmware.x86_64 = { + enable = mkEnableOption "enable x86_64 firmware"; + }; + + config = mkIf cfg.firmware.x86_64 { + hardware.cpu.intel.updateMicrocode = true; + hardware.cpu.amd.updateMicrocode = true; + }; # services.fwupd.enable = true; } \ No newline at end of file