prefect: disable sleep whilst ssh server sessions active
Alan Pearce alan@alanpearce.eu
Sun, 23 Apr 2023 21:48:36 +0200
1 files changed, 5 insertions(+), 0 deletions(-)
jump to
M system/prefect.nix → system/prefect.nix
@@ -123,6 +123,11 @@ enable = true; 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;