diff options
| -rw-r--r-- | hostnix/creep/configuration.nix | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/hostnix/creep/configuration.nix b/hostnix/creep/configuration.nix index 89207a5..cc54ecf 100644 --- a/hostnix/creep/configuration.nix +++ b/hostnix/creep/configuration.nix @@ -47,6 +47,43 @@ services.openssh.enable = true; + systemd.services.reverse-ssh = { + description = "SSH reverse tunnel"; + wantedBy = [ "multi-user.target" ]; + after = [ "network-online.target" ]; + serviceConfig = { + RestartSec = 60; + Restart = "always"; + }; + script = '' + ${pkgs.openssh}/bin/ssh \ + -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes \ + -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \ + -i /etc/ssh/ssh_host_ed25519_key \ + -N -R 19422:localhost:22 joe@popfresh.mou.fo + ''; + }; + + systemd.services.dyndns = { + description = "Dynamic DNS update"; + after = [ "network-online.target" ]; + serviceConfig = { + Type = "oneshot"; + TimeoutStartSec = "60s"; + }; + script = '' + ${pkgs.curl}/bin/curl -fsS https://dyn.dns.he.net/nic/update -d hostname=creep.he.mou.fo -d password=FriE83Y4HPWmwdYn + ''; + }; + + systemd.timers.dyndns = { + wantedBy = [ "multi-user.target" ]; + timerConfig = { + OnStartupSec = "10"; + OnUnitActiveSec = "5min"; + }; + }; + # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It's perfectly fine and recommended to leave |
