mio-ops/profiles/powerManagement.nix

41 lines
856 B
Nix
Raw Normal View History

# Power management configuration for the laptops
{
2022-03-07 14:26:15 +00:00
config,
pkgs,
lib,
...
}: {
powerManagement = {
enable = true;
cpuFreqGovernor = lib.mkDefault "performance";
2021-11-16 04:57:23 +00:00
powertop.enable = true; # Enable powertop auto tuning on startup
};
services = {
2021-05-13 01:36:54 +00:00
logind = {
2023-12-05 02:48:58 +00:00
lidSwitch = "suspend-then-hibernate";
2021-09-03 11:55:08 +00:00
lidSwitchDocked = "ignore";
2021-05-13 01:36:54 +00:00
};
2023-12-05 02:48:58 +00:00
thermald.enable = true;
auto-cpufreq = {
enable = true;
settings = {
battery = {
governor = "powersave";
turbo = "never";
};
charger = {
governor = "performance";
turbo = "auto";
};
};
};
upower = {
2021-11-16 04:57:23 +00:00
enable = true; # Enable application power managemetn support
percentageCritical = 15;
percentageAction = 10;
criticalPowerAction = "Hibernate";
};
};
}