Power Management: Difference between revisions
Replace deprecated sleep extraConfig option that was missed last edit |
|||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 48: | Line 48: | ||
Therefore, an example configuration could look like this:<syntaxhighlight lang="nix"> | Therefore, an example configuration could look like this:<syntaxhighlight lang="nix"> | ||
/ | // I'm hibernating into a logical volume that's also under LUKS. Pretty cool, right? | ||
swapDevices = [ | swapDevices = [ | ||
| Line 69: | Line 67: | ||
== Tips and tricks == | == Tips and tricks == | ||
=== | === Hibernate after specified time === | ||
Using following configuration, your system will go from suspend into hibernate after 1 hour:<syntaxhighlight lang="nix"> | Using following configuration, your system will go from suspend into hibernate after 1 hour:<syntaxhighlight lang="nix"> | ||
systemd.sleep. | systemd.sleep.settings.Sleep = { | ||
HibernateDelaySec=1h | HibernateDelaySec = "1h"; | ||
}; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Disable all sleep functionality === | |||
Some desktop environment and display manager combinations might attempt to put your machine to sleep as default behavior (i.e. SDDM and KDE Plasma 6 under Wayland). If this is not what you want, you can define the following to block any service attempting to put your machine to sleep via systemd: | |||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
systemd.sleep. | systemd.sleep.settings.Sleep = { | ||
AllowHibernation = "no"; | |||
AllowHybridSleep = "no"; | |||
AllowSuspend = "no"; | |||
AllowSuspendThenHibernate=no | AllowSuspendThenHibernate = "no"; | ||
}; | |||
</syntaxhighlight> | </syntaxhighlight> | ||