From d3b15959ced4e2e1887fe144b32c205ee058e4f6 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sun, 20 Oct 2024 16:28:12 -0400 Subject: [PATCH] hwModuled/amd/cpu: switch to zenpower --- hwModules/common/cpu/amd/default.nix | 18 ++++++++++++++-- hwModules/lenovo/legion/go/default.nix | 30 ++++++++++---------------- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/hwModules/common/cpu/amd/default.nix b/hwModules/common/cpu/amd/default.nix index 04e922b7..9b076e27 100644 --- a/hwModules/common/cpu/amd/default.nix +++ b/hwModules/common/cpu/amd/default.nix @@ -1,5 +1,19 @@ -{lib, ...}: { - boot.kernelModules = ["kvm-amd"]; +# Best for Ryzen CPUs +{ + config, + lib, + ... +}: { + boot = { + blacklistedKernelModules = ["k10temp"]; # Conflicts with zenpower + extraModulePackages = with config.boot.kernelPackages; [zenpower]; + + kernelModules = [ + "kvm-amd" + "zenpower" # Improved temperature monitoring + ]; + }; + hardware.cpu.amd.updateMicrocode = true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; } diff --git a/hwModules/lenovo/legion/go/default.nix b/hwModules/lenovo/legion/go/default.nix index cca9b99d..ce6ea901 100644 --- a/hwModules/lenovo/legion/go/default.nix +++ b/hwModules/lenovo/legion/go/default.nix @@ -22,24 +22,18 @@ in { ]; boot = { - initrd = { - availableKernelModules = [ - "amdgpu" - "nvme" - "rtsx_pci_sdmmc" - "sd_mod" - "sdhci_pci" - "thunderbolt" - "usb_storage" - "usbhid" - "xhci_pci" - ]; + initrd.availableKernelModules = [ + "nvme" + "rtsx_pci_sdmmc" + "sd_mod" + "sdhci_pci" + "thunderbolt" + "usb_storage" + "usbhid" + "xhci_pci" + ]; - kernelModules = ["amdgpu"]; - }; - - blacklistedKernelModules = ["k10temp"]; # Conflicts with zenpower - extraModulePackages = with config.boot.kernelPackages; [acpi_call zenpower]; + extraModulePackages = with config.boot.kernelPackages; [acpi_call]; kernel.sysctl = { # Improved file monitoring @@ -67,8 +61,6 @@ in { "vm.watermark_scale_factor" = 125; }; - kernelModules = ["zenpower"]; # Improved temperature monitoring - # Xanmod seems more responsive under load kernelPackages = lib.mkDefault pkgs.linuxPackages_xanmod_latest; };