25 lines
742 B
Nix
25 lines
742 B
Nix
{ ... }:
|
|
{
|
|
services.tlp = {
|
|
enable = true;
|
|
settings = {
|
|
CPU_SCALING_GOVERNOR_ON_BAT = "power_save";
|
|
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
|
PCIE_ASPM_ON_AC = "performance";
|
|
PCIE_ASPM_ON_BAT = "powersave";
|
|
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.thermald.enable = true;
|
|
services.upower = {
|
|
enable = true;
|
|
};
|
|
services.logind.extraConfig = {
|
|
HandlePowerKey = "hibernate"; # Hibernate when the power button is pressed
|
|
HandleLidSwitch = "hibernate"; # Hibernate when the lid is closed
|
|
};
|
|
powerManagement.enable = true;
|
|
}
|