From 98db86c5351406f6c173aa965a0d0bb25973ae3c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 23 Apr 2023 21:48:36 +0200 Subject: prefect: disable sleep whilst ssh server sessions active --- system/prefect.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'system') diff --git a/system/prefect.nix b/system/prefect.nix index e5ebac22..1a25032e 100644 --- a/system/prefect.nix +++ b/system/prefect.nix @@ -123,6 +123,11 @@ openFirewall = false; startWhenNeeded = true; }; + systemd.services."ssh-no-sleep@" = { + bindsTo = [ "sshd@%i.service" ]; + wantedBy = [ "sshd@.service" ]; + serviceConfig.ExecStart = "${pkgs.systemd}/bin/systemd-inhibit --mode block --what sleep --who 'ssh session '%I --why 'session still active' ${pkgs.coreutils}/bin/sleep infinity"; + }; networking.nftables = { enable = true; -- cgit 1.4.1