-
Notifications
You must be signed in to change notification settings - Fork 0
fix(matic): hibernate on battery lid close #2094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -246,8 +246,8 @@ import ../../hosts/nixos { | |
|
|
||
| # Power button behavior - lock screen instead of shutdown | ||
| services.logind.settings.Login.HandlePowerKey = "lock"; | ||
| # Suspend on battery lid close; on AC, Hyprland locks on the lid switch event. | ||
| services.logind.settings.Login.HandleLidSwitch = "suspend"; | ||
| # Hibernate on battery lid close; on AC, Hyprland locks on the lid switch event. | ||
| services.logind.settings.Login.HandleLidSwitch = "hibernate"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Heads-up on the security model: the root LUKS device auto-unlocks via TPM2 ( |
||
| services.logind.settings.Login.HandleLidSwitchExternalPower = "ignore"; | ||
|
|
||
| # Auto timezone (via geolocation) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hibernate has no backing swap on this host.
named-hosts/matic/hardware-configuration.nix:44declaresswapDevices = [ ], and there is noboot.resumeDevice, no swap file, and noresume=/resume_offset=entry inboot.kernelParams(seenamed-hosts/matic/default.nix:58-63) — greppingswap|resume|hibernatacrossnamed-hosts/matic/andhosts/returns only the fprintd-resume unit and this new line.When systemd-logind receives the lid-close event it will call
hibernate.target, which systemd refuses withNot enough swap space for hibernation/Sleep verb "hibernate" not supported. Net effect on battery: closing the lid does nothing — the machine stays awake in your bag. That's a regression from the previoussuspendbehavior and a real thermal/battery risk.Fix direction: either revert to
suspend(orsuspend-then-hibernate), or land the hibernation prerequisites first — e.g. add a swap partition/file sized for RAM plusboot.resumeDevice = "/dev/disk/by-uuid/..."(andresume_offsetif using a swap file), ideally on an encrypted volume separate from the TPM2-auto-unlocked root.