qol(laptop): battery either on balanced or powersaving
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
{ ... }:
|
{ pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
|
|
||||||
in
|
in
|
||||||
@@ -6,10 +6,10 @@ in
|
|||||||
services.tlp = {
|
services.tlp = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
CPU_SCALING_GOVERNOR_ON_BAT = "laptop-battery-powersave";
|
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
||||||
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
PCIE_ASPM_ON_BAT = "powersave";
|
||||||
PCIE_ASPM_ON_AC = "performance";
|
CPU_SCALING_GOVERNOR_ON_AC = "balanced";
|
||||||
PCIE_ASPM_ON_BAT = "laptop-battery-powersave";
|
PCIE_ASPM_ON_AC = "balanced";
|
||||||
START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge
|
START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge
|
||||||
STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging
|
STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging
|
||||||
};
|
};
|
||||||
@@ -19,11 +19,16 @@ in
|
|||||||
services.upower = {
|
services.upower = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
# boot.kernelParams = [ "mem_sleep_default=deep" ];
|
||||||
services.logind.settings.Login = {
|
services.logind.settings.Login = {
|
||||||
HandleLidSwitch = "hibernate";
|
HandleLidSwitch = "suspend-then-hibernate";
|
||||||
HandleLidSwitchExternalPower = "lock";
|
HandleLidSwitchExternalPower = "ignore";
|
||||||
HandleLidSwitchDocked = "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"
|
# one of "ignore", "poweroff", "reboot", "halt", "kexec", "suspend", "hibernate", "hybrid-sleep", "suspend-then-hibernate", "lock"
|
||||||
powerManagement = {
|
powerManagement = {
|
||||||
|
|||||||
Reference in New Issue
Block a user