courge: openssh: inhibit suspend
authorJulien Moutinho <julm+julm-nix@sourcephile.fr>
Sun, 20 Oct 2024 21:29:00 +0000 (23:29 +0200)
committerJulien Moutinho <julm+julm-nix@sourcephile.fr>
Sun, 20 Oct 2024 21:29:21 +0000 (23:29 +0200)
hosts/courge/networking.nix

index 4bbf14601b650f1ccd370b3dca43bc8bf9c9c664..dfc1a14319914e0e6eda4777239b883744a75849 100644 (file)
@@ -35,4 +35,8 @@
   systemd.services.sshd.serviceConfig.LoadCredentialEncrypted = [
     "host.key:${ssh/host.key.cred}"
   ];
+  services.openssh.extraConfig = ''
+    Match User julm
+      ForceCommand systemd-inhibit --who="SSH session" --why="Active ssh user blocks suspend" --what=idle --mode=block bash
+  '';
 }