From 19cf9d640d1e7c3cdab01ad362945a051721d9b1 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Wed, 6 Apr 2022 06:37:34 -0700 Subject: refactor configuration for AMD --- modules/hardware/amd/default.nix | 13 +++++++++++++ modules/hardware/default.nix | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 modules/hardware/amd/default.nix (limited to 'modules/hardware') diff --git a/modules/hardware/amd/default.nix b/modules/hardware/amd/default.nix new file mode 100644 index 0000000..05362db --- /dev/null +++ b/modules/hardware/amd/default.nix @@ -0,0 +1,13 @@ +{ config, lib, ... }: +let cfg = config.my.hardware.amd; +in { + options.my.hardware.amd = with lib; { + enable = mkEnableOption "AMD related configuration"; + }; + + config = lib.mkIf cfg.enable { + # Enable microcode update + hardware.cpu.amd.updateMicrocode = true; + boot.kernelModules = [ "kvm-amd" ]; + }; +} diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix index 62208c1..843c1f5 100644 --- a/modules/hardware/default.nix +++ b/modules/hardware/default.nix @@ -1,5 +1,5 @@ { ... }: { - imports = [ ./intel ./ssd ./sound ./networking ]; + imports = [ ./amd ./intel ./ssd ./sound ./networking ]; } -- cgit 1.4.1