mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 04:08:12 +09:00
38 lines
699 B
Nix
38 lines
699 B
Nix
{
|
|
lib,
|
|
config,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.my.system.power;
|
|
in
|
|
{
|
|
options.my.system.power = {
|
|
enable = lib.mkEnableOption "power management";
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
boot.kernelParams = [
|
|
"mem_sleep_default=deep"
|
|
];
|
|
|
|
powerManagement = {
|
|
enable = true;
|
|
powertop.enable = true;
|
|
};
|
|
|
|
services.power-profiles-daemon.enable = true;
|
|
services.tlp.enable = false;
|
|
services.upower.enable = true;
|
|
|
|
services.logind = {
|
|
settings.Login = {
|
|
HandleLidSwitch = "suspend";
|
|
HandleLidSwitchDocked = "ignore";
|
|
HandleLidSwitchExternalPower = "suspend";
|
|
LidSwitchIgnoreInhibited = "no";
|
|
};
|
|
};
|
|
};
|
|
}
|