add microcode updates

Signed-off-by: Xe <me@christine.website>
This commit is contained in:
Cadey Ratio 2021-12-21 17:18:14 -05:00
parent dcd75e0a4c
commit e688ff36ae
3 changed files with 18 additions and 5 deletions

View File

@ -1,5 +1,5 @@
{ config, lib, pkgs, ... }: {
imports = [ ./users ];
imports = [ ./users ./microcode.nix ];
boot.cleanTmpDir = true;
boot.kernelModules = [ "wireguard" ];

13
common/microcode.nix Normal file
View File

@ -0,0 +1,13 @@
{ config, lib, ... }: {
options = {
within.microcode = {
enable = lib.mkEnableOption "Enables CPU Microcode updates";
vendor = lib.mkOption { type = lib.types.enum [ "intel" "amd" ]; };
};
};
config = lib.mkIf config.within.microcode.enable {
hardware.cpu.intel.updateMicrocode = (config.cadey.cpu.vendor == "intel");
hardware.cpu.amd.updateMicrocode = (config.cadey.cpu.vendor == "amd");
};
}

View File

@ -30,10 +30,10 @@
services.zfs.autoSnapshot.enable = true;
services.zfs.trim.enable = true;
# cadey.cpu = {
# enable = true;
# vendor = "intel";
# };
within.microcode = {
enable = true;
vendor = "intel";
};
security.sudo.wheelNeedsPassword = false;