diff options
author | Alan Pearce | 2023-04-23 21:48:36 +0200 |
---|---|---|
committer | Alan Pearce | 2023-04-23 21:48:36 +0200 |
commit | 98db86c5351406f6c173aa965a0d0bb25973ae3c (patch) | |
tree | f47f431d69d11cbd0a9b2b13b2a753182274084a | |
parent | 162d59aea1c7690c0fceaeaeddb7cc885b719c1b (diff) | |
download | nixfiles-98db86c5351406f6c173aa965a0d0bb25973ae3c.tar.lz nixfiles-98db86c5351406f6c173aa965a0d0bb25973ae3c.tar.zst nixfiles-98db86c5351406f6c173aa965a0d0bb25973ae3c.zip |
prefect: disable sleep whilst ssh server sessions active
-rw-r--r-- | system/prefect.nix | 5 |
1 files changed, 5 insertions, 0 deletions
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; |