-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
nixos/systemd: Add suspend-then-hibernate #58404
Conversation
@Semptic out of interest, does hibernation work with encrypted swap devices? |
@@ -673,6 +675,28 @@ in | |||
''; | |||
}; | |||
|
|||
services.sleep.hibernateDelaySec = mkOption { | |||
default = 3600; | |||
type = types.int; |
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.
type = types.int; | |
type = with types; nullOr int; |
and default = null
, and appropriate config to NOT enable hibernate when hibernateDelaySec == null
. It is a bad idea to enable suspend-then-hibernate for all, because not everyone has enough swap to manage hibernate.
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.
I don't know if we really need this. As I understand the docs you must call systemctl suspend-then-hibernate
explicitly to get the hibernation. Suspend will still just supend and never got to hibernate.
My another objection is that
The I look forward for this PR, as I was once interested in this feature! |
This commit enables nixos to use suspend-then-hibernate. This adds suspend-then-hibernate systemd service/target and also adds the according settings for sleep.conf.
1774fc6
to
3cd3c26
Compare
Is there a reason this PR was closed? |
This is a duplicate of #53025, but also adds the according settings of sleep.conf.
Motivation for this change
This pr enables nixos to use suspend-then-hibernate.
This adds suspend-then-hibernate systemd service/target and
also adds the according settings for sleep.conf.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)