From 3a4a16bf204a0ab7abbef24bc9132fec50fede5a Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Tue, 31 Aug 2021 18:15:06 +0200 Subject: [PATCH] hardware: Add microcode updates --- hosts/miku.nix | 2 +- modules/hardware/amd.nix | 5 +++++ modules/hardware/intel.nix | 6 +++++- modules/host.nix | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 modules/hardware/amd.nix diff --git a/hosts/miku.nix b/hosts/miku.nix index 791bb01..d49c18d 100644 --- a/hosts/miku.nix +++ b/hosts/miku.nix @@ -10,7 +10,7 @@ in mkHost { userName = "alexander"; hostName = "miku"; overlays = [ "nur" "steam" "unstable" "simple" "custom" "emacs" ]; - hardwareImports = [ "amdgpu" ]; + hardwareImports = [ "amdgpu" "amd" ]; programImports = [ "zsh" "git" "mpv" "tmux" "emacs" "firefox" "gnome-terminal" "gnome" "i18n" "gamemode" "nonvm" "distributed-build/builder.nix" diff --git a/modules/hardware/amd.nix b/modules/hardware/amd.nix new file mode 100644 index 0000000..c069d2f --- /dev/null +++ b/modules/hardware/amd.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + hardware.cpu.amd.updateMicrocode = true; +} diff --git a/modules/hardware/intel.nix b/modules/hardware/intel.nix index 52fcada..b336996 100644 --- a/modules/hardware/intel.nix +++ b/modules/hardware/intel.nix @@ -3,7 +3,11 @@ }: { - hardware.opengl.extraPackages = with pkgs; [ vaapiIntel intel-media-driver ]; + hardware = { + cpu.intel.updateMicrocode = true; + # NOTE: Assuming each Intel CPU has integrated graphics + opengl.extraPackages = with pkgs; [ vaapiIntel intel-media-driver ]; + }; # TODO: Remove? services.xserver.videoDrivers = [ "modesetting" "fbdev" ]; } diff --git a/modules/host.nix b/modules/host.nix index cc86cd8..17ac0ee 100644 --- a/modules/host.nix +++ b/modules/host.nix @@ -86,7 +86,7 @@ let # We don't tolerate non-free software, except for Steam and Linux firmware nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ - "firmwareLinuxNonfree" + "firmwareLinuxNonfree" "microcodeAmd" "microcodeIntel" "steam" "steam-original" "steam-runtime" "discord" ];