powerbutton/lid-switch: tune the desired actions

This commit is contained in:
Colin 2023-12-17 21:08:16 +00:00
parent fd0f709d50
commit 1063a89541

View File

@ -64,8 +64,12 @@
powerManagement.cpuFreqGovernor = "ondemand";
services.logind.extraConfig = ''
# dont shutdown when power button is short-pressed
HandlePowerKey=ignore
# see: `man logind.conf`
# dont shutdown when power button is short-pressed (commonly done an accident, or by cats).
# but do on long-press: useful to gracefully power-off server.
HandlePowerKey=lock
HandlePowerKeyLongPress=poweroff
HandleLidSwitch=lock
'';
# some packages build only if binfmt *isn't* present