Open mpapamanz opened 9 months ago
Filing a bug in case I missed something or there is already someone working on it. Please let me know if you want me to implement this (it seems a pretty trivial configuration piping from nix to logind.conf and I should be able to contribute to it even if new to Nix)
I believe that this should be in the [Sleep]
section of sleep.conf
, not of logind.conf
. Such an option should thus be added to services.sleep
, which would need to be created. Other options that should be added to such are also in the documentation linked above.
Describe the bug
Per suspend-then-hibernate documentation, the system can hibernate in 2 cases
n
seconds whenHibernateDelaySec=n
(in the[Sleep]
section of logind.conf) is setCurrently logind.nix doesn't allow to set HibernateDelaySec (nor any other parameter in
[Sleep]
if I read the nix file correctly).Steps To Reproduce
Steps to reproduce the behavior:
services.logind.hibernateDelay
Expected behavior
Have a
services.logind.hibernateDelay
(or similar) option that setsScreenshots
If applicable, add screenshots to help explain your problem.
Additional context
This is relevant for a laptop that, for example, it is used at a desk. Then it is necessary to go to a meeting and open the laptop from the meeting room (without waiting 1m till the system is restored from disk). On the other hand, it is desirable at the end of the day when the lid is closed for good that the system is hibernate and the additional restore time is acceptable. This can be achieved with sleep-then-hibernate + HibernateDelaySec set to 30m (or something like that)
Having only sleep causes overheating when the laptop is carried around, (relatively) fast battery draining and risking to damage the battery if it reaches 0% (current batteries get damaged when they reach <5-10%) Having only hibernate is inconvenient when the lid is closed for a small amount of time (e.g., time to go to a meeting room)
Notify maintainers
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.` - system:
"x86_64-linux"`Linux 6.1.67, NixOS, 23.11 (Tapir), 23.11.1779.cf28ee258fd5
yes
yes
nix-env (Nix) 2.18.1
/nix/var/nix/profiles/per-user/root/channels/nixos
Add a :+1: reaction to issues you find important.