From acab42eaef298b20f2de801cab03458bffe76ad7 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sun, 14 Aug 2022 20:11:10 +0200 Subject: [PATCH] Add ssh-tunnel systemd unit to enable backups from IPv4-only to IPv6-only host --- hosts/droppie/droppie.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hosts/droppie/droppie.nix b/hosts/droppie/droppie.nix index 47be886c..8918cde2 100644 --- a/hosts/droppie/droppie.nix +++ b/hosts/droppie/droppie.nix @@ -25,5 +25,18 @@ in ]; } ]; + + systemd.user.services.ssh-tunnel-cloud-pub-solar = { + unitConfig = { + Description = "Reverse SSH connection to enable backups from IPv4-only to IPv6-only host"; + After = [ "network.target" ]; + }; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.openssh}/bin/ssh -vvv -g -N -T -o 'ServerAliveInterval 10' -o 'ExitOnForwardFailure yes' -R 127.0.0.1:22022:localhost:22 cloud.pub.solar"; + Restart = "always"; + RestartSec = "5s"; + }; + }; }; }