mio-ops/profiles/powerManagement.nix
Serĉanto de Scio 9d74b29b52
tasko(powerManagement): forigi cpu-freq
Ŝajnas konflikti kun io kontraŭflue.

Progresses #3
2024-12-04 11:02:47 +10:00

44 lines
1 KiB
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";
# powerKey = "suspend-then-hibernate"; # Enable in 23.11
extraConfig = ''
HandlePowerKey=suspend-then-hibernate
IdleAction=suspend-then-hibernate
IdleActionSec=10m
'';
};
thermald.enable = true;
upower = {
enable = true; # Enable application power managemetn support
percentageCritical = 15;
percentageAction = 10;
criticalPowerAction = "Hibernate";
};
};
programs.xss-lock = {
enable = true;
lockerCommand = "${pkgs.xscreensaver}/bin/screensaver-command -lock";
extraOptions = [
"-n ${pkgs.libnotify}/bin/notify-send \"Locking screen now\""
"IdleAction=lock"
"IdleActionSec=5m"
];
};
}