summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-02-14 07:45:05 +0530
committersinanmohd <sinan@sinanmohd.com>2024-02-14 07:46:15 +0530
commit92d993b5d3a5b38b58d24e3d04234d11a00f3e67 (patch)
treec02d26e8c0ee9f33b54328c73be4a7185a64853d
parent4e2a013677ff03538415592e345609e31e9f0d64 (diff)
hosts/lia/sshfwd/mkFwdSrv: always restart
-rw-r--r--hosts/lia/modules/sshfwd.nix18
1 files changed, 11 insertions, 7 deletions
diff --git a/hosts/lia/modules/sshfwd.nix b/hosts/lia/modules/sshfwd.nix
index 4140660..582afc7 100644
--- a/hosts/lia/modules/sshfwd.nix
+++ b/hosts/lia/modules/sshfwd.nix
@@ -17,13 +17,17 @@
# the ssh from dying during switch-to-configuration.
stopIfChanged = false;
- path = [ pkgs.openssh ];
- script = ''
- echo -n "Forwarding port ${toString local_port}"
- exec ssh -N ${remote_user}@${remote} -p ${toString ssh_port} \
- -R '[::]:${toString remote_port}:127.0.0.1:${toString local_port}' \
- -i ${key}
- '';
+ serviceConfig = {
+ ExecStart = ''
+ ${pkgs.openssh}/bin/ssh -N ${remote_user}@${remote} -p ${toString ssh_port} \
+ -R '[::]:${toString remote_port}:127.0.0.1:${toString local_port}' \
+ -i ${key}
+ '';
+
+ RestartSec = 1;
+ Restart = "always";
+ };
+
};
};
in {