Skip to content

Commit 57faf93

Browse files
committed
Factor out disable-suspend.nix from machines/mini
I'm going to share it.
1 parent 95258bd commit 57faf93

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

cfg/disable-suspend.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
# Disable the GNOME3/GDM auto-suspend feature that cannot be disabled in GUI!
3+
# If no user is logged in, the machine will power down after 20 minutes.
4+
systemd.targets.sleep.enable = false;
5+
systemd.targets.suspend.enable = false;
6+
systemd.targets.hibernate.enable = false;
7+
systemd.targets.hybrid-sleep.enable = false;
8+
}

machines/mini/configuration.nix

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ in
1919
../../cfg/base-big.nix
2020
../../cfg/cgit.nix
2121
../../cfg/clamav.nix
22+
../../cfg/disable-suspend.nix
2223
../../cfg/gitolite.nix
2324
../../cfg/git-daemon.nix
2425
../../cfg/backup-server.nix
@@ -302,12 +303,6 @@ in
302303
};
303304
};
304305

305-
# Disable the GNOME3/GDM auto-suspend feature that cannot be disabled in GUI!
306-
systemd.targets.sleep.enable = false;
307-
systemd.targets.suspend.enable = false;
308-
systemd.targets.hibernate.enable = false;
309-
systemd.targets.hybrid-sleep.enable = false;
310-
311306
systemd.services.archive-photos-from-syncthing = {
312307
description = "Archive photos from Syncthing";
313308
startAt = "weekly";

0 commit comments

Comments
 (0)