Skip to content

Commit 5e5e564

Browse files
committed
idle/power: minor adjustments for all targets
- enable idleManagement for all targets - change power button behavior to ignore short press Signed-off-by: Kajus Naujokaitis <kajus.naujokaitis@unikie.com>
1 parent ba73c8f commit 5e5e564

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

modules/common/services/power.nix

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -525,23 +525,26 @@ in
525525
in
526526
mkDefault {
527527
HandleLidSwitch = lidEvent;
528-
HandleLidSwitchDocked = lidEvent;
529-
HandleLidSwitchExternalPower = lidEvent;
528+
HandleLidSwitchDocked = "ignore";
529+
HandleLidSwitchExternalPower = "ignore";
530+
# Below keys are usually handled by host anyway
530531
HandleSuspendKey = "ignore";
531532
HandleHibernateKey = "ignore";
532533
HandlePowerKey = "ignore";
533534
HandlePowerKeyLongPress = "ignore";
534535
KillUserProcesses = true;
535-
IdleAction = "lock";
536-
IdleActionSec = "10min";
537536
UserStopDelaySec = 0;
538-
HoldoffTimeoutSec = 20;
539537
};
540538
})
541539

542540
# Host power management
543541
(mkIf cfg.host.enable {
544-
services.logind.settings.Login.HandleLidSwitch = mkDefault "ignore";
542+
# Host still handles power buttons in most situations
543+
services.logind.settings.Login = {
544+
HandleLidSwitch = mkDefault "ignore";
545+
# Disable accidental poweroff with light touch
546+
HandlePowerKey = mkDefault "ignore";
547+
};
545548

546549
systemd.sleep.extraConfig = genericSleepConf;
547550

targets/laptop/flake-module.nix

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ let
5858
ghaf = {
5959
reference.profiles.mvp-user-trial.enable = true;
6060
partitioning.disko.enable = true;
61-
services.power-manager.allowSuspend = false;
61+
services.power-manager.suspend.enable = false;
6262
};
6363
}
6464
]))
@@ -102,7 +102,6 @@ let
102102
ghaf = {
103103
reference.profiles.mvp-user-trial.enable = true;
104104
partitioning.disko.enable = true;
105-
profiles.graphics.idleManagement.enable = false;
106105
services.performance.host.thermalLimitMode = "enabled";
107106
};
108107
}
@@ -280,7 +279,6 @@ let
280279
ghaf = {
281280
reference.profiles.mvp-user-trial.enable = true;
282281
partitioning.disko.enable = true;
283-
profiles.graphics.idleManagement.enable = false;
284282
};
285283
}
286284
]))

0 commit comments

Comments
 (0)