69 lines
1.4 KiB
Nix

{
config,
lib,
pkgs,
...
}:
{
services.tlp = {
enable = true;
settings = {
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 50;
};
};
# services.superfreq = {
# enable = true;
# settings = {
# charger = {
# governor = "performance";
# turbo = "auto";
# epp = "performance";
# epb = "balance_performance";
# platform_profile = "performance";
# };
# battery = {
# governor = "powersave";
# turbo = "auto";
# epp = "power";
# epb = "balance_power";
# platform_profile = "low-power";
# min_freq_mhz = 800;
# max_freq_mhz = 2500;
# };
# daemon = {
# poll_interval_sec = 10;
# adaptive_interval = true;
# min_poll_interval_sec = 1;
# max_poll_interval_sec = 30;
# throttle_on_battery = true;
# };
# battery_charge_thresholds = [50 90];
# };
# # logind.lidSwitchExternalPower = "ignore"; # prevent lid switch from triggering a suspend
# };
systemd.sleep.extraConfig = ''
AllowSuspend=yes
AllowHibernation=yes
AllowHybridSleep=yes
AllowSuspendThenHibernate=yes
'';
}