34 lines
916 B
Nix
34 lines
916 B
Nix
{ ... }:
|
|
let
|
|
|
|
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";
|
|
START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge
|
|
STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging
|
|
};
|
|
};
|
|
# services.tuned.enable = true;
|
|
services.thermald.enable = true;
|
|
services.upower = {
|
|
enable = true;
|
|
};
|
|
services.logind.settings.Login = {
|
|
HandleLidSwitch = "hibernate";
|
|
HandleLidSwitchExternalPower = "lock";
|
|
HandleLidSwitchDocked = "ignore";
|
|
};
|
|
|
|
# one of "ignore", "poweroff", "reboot", "halt", "kexec", "suspend", "hibernate", "hybrid-sleep", "suspend-then-hibernate", "lock"
|
|
powerManagement = {
|
|
enable = true;
|
|
powertop.enable = true;
|
|
};
|
|
}
|