summary refs log tree commit diff stats
path: root/system/prefect.nix
diff options
context:
space:
mode:
authorAlan Pearce2023-04-23 21:48:36 +0200
committerAlan Pearce2023-04-23 21:48:36 +0200
commit98db86c5351406f6c173aa965a0d0bb25973ae3c (patch)
treef47f431d69d11cbd0a9b2b13b2a753182274084a /system/prefect.nix
parent162d59aea1c7690c0fceaeaeddb7cc885b719c1b (diff)
downloadnixfiles-98db86c5351406f6c173aa965a0d0bb25973ae3c.tar.lz
nixfiles-98db86c5351406f6c173aa965a0d0bb25973ae3c.tar.zst
nixfiles-98db86c5351406f6c173aa965a0d0bb25973ae3c.zip
prefect: disable sleep whilst ssh server sessions active
Diffstat (limited to 'system/prefect.nix')
-rw-r--r--system/prefect.nix5
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;