about summary refs log tree commit diff
path: root/nixos/modules/system
diff options
context:
space:
mode:
authorJanne Heß <janne@hess.ooo>2019-08-26 11:04:10 +0200
committerJanne Heß <janne@hess.ooo>2019-08-26 11:04:10 +0200
commitc8e863e25ecc7e20836f8f9275329d5afd5e4f0e (patch)
treec8529f1664709bad97e144a6d29c58150847ce3b /nixos/modules/system
parentd41b832ac24f57a3412d3004ad4a5eba2f387de8 (diff)
downloadnixlib-c8e863e25ecc7e20836f8f9275329d5afd5e4f0e.tar
nixlib-c8e863e25ecc7e20836f8f9275329d5afd5e4f0e.tar.gz
nixlib-c8e863e25ecc7e20836f8f9275329d5afd5e4f0e.tar.bz2
nixlib-c8e863e25ecc7e20836f8f9275329d5afd5e4f0e.tar.lz
nixlib-c8e863e25ecc7e20836f8f9275329d5afd5e4f0e.tar.xz
nixlib-c8e863e25ecc7e20836f8f9275329d5afd5e4f0e.tar.zst
nixlib-c8e863e25ecc7e20836f8f9275329d5afd5e4f0e.zip
nixos/systemd: Add suspend-then-hibernate units
Pretty useful for laptops. I use them with:

```
services.logind.lidSwitch = "suspend-then-hibernate";
environment.etc."systemd/sleep.conf".text = "HibernateDelaySec=8h";
```
Diffstat (limited to 'nixos/modules/system')
-rw-r--r--nixos/modules/system/boot/systemd.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index 23a2dd45d492..fedb2ebe86fb 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -112,11 +112,13 @@ let
       # Hibernate / suspend.
       "hibernate.target"
       "suspend.target"
+      "suspend-then-hibernate.target"
       "sleep.target"
       "hybrid-sleep.target"
       "systemd-hibernate.service"
       "systemd-hybrid-sleep.service"
       "systemd-suspend.service"
+      "systemd-suspend-then-hibernate.service"
 
       # Reboot stuff.
       "reboot.target"