Skip to content

Commit 3bfc5ca

Browse files
kajusnaubrianmcgillion
authored andcommitted
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 63619da commit 3bfc5ca

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
@@ -534,23 +534,26 @@ in
534534
in
535535
mkDefault {
536536
HandleLidSwitch = lidEvent;
537-
HandleLidSwitchDocked = lidEvent;
538-
HandleLidSwitchExternalPower = lidEvent;
537+
HandleLidSwitchDocked = "ignore";
538+
HandleLidSwitchExternalPower = "ignore";
539+
# Below keys are usually handled by host anyway
539540
HandleSuspendKey = "ignore";
540541
HandleHibernateKey = "ignore";
541542
HandlePowerKey = "ignore";
542543
HandlePowerKeyLongPress = "ignore";
543544
KillUserProcesses = true;
544-
IdleAction = "lock";
545-
IdleActionSec = "10min";
546545
UserStopDelaySec = 0;
547-
HoldoffTimeoutSec = 20;
548546
};
549547
})
550548

551549
# Host power management
552550
(mkIf cfg.host.enable {
553-
services.logind.settings.Login.HandleLidSwitch = mkDefault "ignore";
551+
# Host still handles power buttons in most situations
552+
services.logind.settings.Login = {
553+
HandleLidSwitch = mkDefault "ignore";
554+
# Disable accidental poweroff with light touch
555+
HandlePowerKey = mkDefault "ignore";
556+
};
554557

555558
# We can accomplish the same via systemd.sleep.extraConfig MemorySleepMode
556559
# but it seems keyboard wakeup stops functioning with that approach

targets/laptop/flake-module.nix

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ let
6767
extraConfig = {
6868
reference.profiles.mvp-user-trial.enable = true;
6969
partitioning.disko.enable = true;
70-
services.power-manager.allowSuspend = false;
70+
services.power-manager.suspend.enable = false;
7171
};
7272
})
7373

@@ -117,7 +117,6 @@ let
117117
extraConfig = {
118118
reference.profiles.mvp-user-trial.enable = true;
119119
partitioning.disko.enable = true;
120-
profiles.graphics.idleManagement.enable = false;
121120
services.performance.host.thermalLimitMode = "enabled";
122121
};
123122
})
@@ -338,7 +337,6 @@ let
338337
extraConfig = {
339338
reference.profiles.mvp-user-trial.enable = true;
340339
partitioning.disko.enable = true;
341-
profiles.graphics.idleManagement.enable = false;
342340
};
343341
})
344342

0 commit comments

Comments
 (0)