From 3c86eb149ede1850499a3525a6828a2db9a379c4 Mon Sep 17 00:00:00 2001 From: Doloro1978 Date: Sat, 27 Dec 2025 13:28:55 +0000 Subject: [PATCH] qol(laptop): battery either on balanced or powersaving --- hosts/doloro-laptop/laptop.nix | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/hosts/doloro-laptop/laptop.nix b/hosts/doloro-laptop/laptop.nix index 0d3b18e..8df4788 100644 --- a/hosts/doloro-laptop/laptop.nix +++ b/hosts/doloro-laptop/laptop.nix @@ -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 = {