Power Management: Difference between revisions
imported>Skylark Drop a redlink, add See also: Laptop which overlaps with this article |
Add notes on hibernation |
||
Line 27: | Line 27: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Troubleshooting | == Hibernation == | ||
Hibernation requires a configured swap device. See [https://nixos.org/manual/nixos/stable/#ch-installation installation instructions] on how to create a swap partition. An example configuration could look like this:<syntaxhighlight lang="nix"> | |||
swapDevices = [ | |||
{ | |||
device = "/dev/hda7"; | |||
} | |||
]; | |||
boot.resumeDevice = "/dev/hda7"; | |||
</syntaxhighlight>Please note that encrypted swap devices or swap files are not yet supported for hibernation. | |||
Test and use hibernation with following command:<syntaxhighlight lang="nix"> | |||
systemctl hibernate | |||
</syntaxhighlight> | |||
== Tips and tricks == | |||
=== Go into hibernate after specific suspend time === | |||
Using following configuration, your system will go from suspend into hibernate after 1 hour:<syntaxhighlight lang="nix"> | |||
systemd.sleep.extraConfig = '' | |||
HibernateDelaySec=1h | |||
''; | |||
</syntaxhighlight> | |||
== Troubleshooting == | |||
==== System immediately wakes up from suspend ==== | ==== System immediately wakes up from suspend ==== |