mio-ops/profiles/powerManagement.nix

41 lines
856 B
Nix

# Power management configuration for the laptops
{
config,
pkgs,
lib,
...
}: {
powerManagement = {
enable = true;
cpuFreqGovernor = lib.mkDefault "performance";
powertop.enable = true; # Enable powertop auto tuning on startup
};
services = {
logind = {
lidSwitch = "suspend-then-hibernate";
lidSwitchDocked = "ignore";
};
thermald.enable = true;
auto-cpufreq = {
enable = true;
settings = {
battery = {
governor = "powersave";
turbo = "never";
};
charger = {
governor = "performance";
turbo = "auto";
};
};
};
upower = {
enable = true; # Enable application power managemetn support
percentageCritical = 15;
percentageAction = 10;
criticalPowerAction = "Hibernate";
};
};
}