From 03a1560b0f97d90fcd687d21e57dbb95e7595709 Mon Sep 17 00:00:00 2001 From: zuckerberg <5-zuckerberg@users.noreply.git.neet.dev> Date: Sun, 9 May 2021 02:09:18 -0400 Subject: [PATCH] x86_64 firmware on that target only --- common/boot/bios.nix | 2 ++ common/boot/efi.nix | 2 ++ common/boot/firmware.nix | 16 +++++++++++++--- 3 files changed, 17 insertions(+), 3 deletions(-) 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