qol(laptop): battery either on balanced or powersaving

This commit is contained in:
2025-12-27 13:28:55 +00:00
parent 49deb7991d
commit 3c86eb149e

View File

@@ -1,4 +1,4 @@
{ ... }:
{ pkgs, lib, ... }:
let
in
@@ -6,10 +6,10 @@ in
services.tlp = {
enable = true;
settings = {
CPU_SCALING_GOVERNOR_ON_BAT = "laptop-battery-powersave";
CPU_SCALING_GOVERNOR_ON_AC = "performance";
PCIE_ASPM_ON_AC = "performance";
PCIE_ASPM_ON_BAT = "laptop-battery-powersave";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
PCIE_ASPM_ON_BAT = "powersave";
CPU_SCALING_GOVERNOR_ON_AC = "balanced";
PCIE_ASPM_ON_AC = "balanced";
START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge
STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging
};
@@ -19,11 +19,16 @@ in
services.upower = {
enable = true;
};
# boot.kernelParams = [ "mem_sleep_default=deep" ];
services.logind.settings.Login = {
HandleLidSwitch = "hibernate";
HandleLidSwitchExternalPower = "lock";
HandleLidSwitch = "suspend-then-hibernate";
HandleLidSwitchExternalPower = "ignore";
HandleLidSwitchDocked = "ignore";
};
systemd.sleep.extraConfig = ''
HibernateDelaySec=30min
SuspendEstimationSec=120
'';
# one of "ignore", "poweroff", "reboot", "halt", "kexec", "suspend", "hibernate", "hybrid-sleep", "suspend-then-hibernate", "lock"
powerManagement = {