extract ssh idle sleep/shutdown configuration
1 file changed, 19 insertions(+), 0 deletions(-)
changed files
A system/settings/configuration/ssh-inhibit-idle.nix
@@ -0,0 +1,19 @@ +{ + config, + pkgs, + ... +}: +{ + services.openssh.startWhenNeeded = true; + systemd.services."ssh-inhibit-idle@" = { + bindsTo = [ "sshd@%i.service" ]; + wantedBy = [ "sshd@.service" ]; + serviceConfig.ExecStart = '' + ${pkgs.systemd}/bin/systemd-inhibit \ + --mode block --what idle \ + --who 'ssh session '%I \ + --why 'session still active' \ + ${pkgs.coreutils}/bin/sleep infinity + ''; + }; +}