From f544ea67fe2dcf1f802dfe5f625f85cf7b500baf Mon Sep 17 00:00:00 2001 From: Thomas Syms Date: Thu, 29 May 2025 13:27:12 -0300 Subject: [PATCH] Improved configuration --- hosts/common/optional/thermal-management.nix | 27 +++++++++++++++++++ hosts/nixos/Bellerophon/default.nix | 1 + .../Bellerophon/hardware-configuration.nix | 3 +-- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 hosts/common/optional/thermal-management.nix diff --git a/hosts/common/optional/thermal-management.nix b/hosts/common/optional/thermal-management.nix new file mode 100644 index 0000000..5cfca59 --- /dev/null +++ b/hosts/common/optional/thermal-management.nix @@ -0,0 +1,27 @@ +{ + services.thermald.enable = true; + + services.tlp = { + enable = true; + settings = { + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + + CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; + CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; + + CPU_MIN_PERF_ON_AC = 0; + CPU_MAX_PERF_ON_AC = 100; + CPU_MIN_PERF_ON_BAT = 0; + CPU_MAX_PERF_ON_BAT = 20; + + #Optional helps save long term battery health + #START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge + #STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging + }; + }; + + powerManagement.powertop.enable = true; + + services.power-profiles-daemon.enable = false; +} diff --git a/hosts/nixos/Bellerophon/default.nix b/hosts/nixos/Bellerophon/default.nix index 282e981..4369984 100644 --- a/hosts/nixos/Bellerophon/default.nix +++ b/hosts/nixos/Bellerophon/default.nix @@ -65,6 +65,7 @@ "hosts/common/optional/audio.nix" # pipewire and cli controls "hosts/common/optional/kde.nix" "hosts/common/optional/sddm.nix" + "hosts/common/optional/thermal-management.nix" ]) ]; diff --git a/hosts/nixos/Bellerophon/hardware-configuration.nix b/hosts/nixos/Bellerophon/hardware-configuration.nix index 6d8a64b..2ae5e4f 100644 --- a/hosts/nixos/Bellerophon/hardware-configuration.nix +++ b/hosts/nixos/Bellerophon/hardware-configuration.nix @@ -14,7 +14,7 @@ boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "vmd" "nvme" "usbhid"]; boot.initrd.kernelModules = []; - boot.kernelPackages = pkgs.linuxPackages_6_12; + boot.kernelPackages = pkgs.linuxPackages_zen; boot.kernelModules = ["kvm-intel"]; boot.kernelPatches = [ /* @@ -25,7 +25,6 @@ */ ]; - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's # still possible to use this option, but it's recommended to use it in conjunction