From 7510f22640aaf52b859d0eb04a3ee867cf406919 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 18 Apr 2023 20:47:43 +0200 Subject: Configure ddclient to update AAAA record for prefect --- system/prefect.nix | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'system') diff --git a/system/prefect.nix b/system/prefect.nix index 829621ef..ec481e22 100644 --- a/system/prefect.nix +++ b/system/prefect.nix @@ -136,5 +136,40 @@ hostName = "prefect"; }; + services.ddclient = { + enable = true; + package = (pkgs.ddclient.overrideAttrs + (old: { + patches = (old.patches or [ ]) ++ [ + ../patches/ddclient-noipv4.patch + ]; + })); + use = "no"; + protocol = "nsupdate"; + verbose = true; + zone = "alanpearce.eu"; + server = "pappel.alanpearce.eu"; + passwordFile = "/etc/secrets/ddns.key"; + domains = [ "prefect.home.alanpearce.eu" ]; + extraConfig = '' + usev4=disabled + usev6=cmdv6 + cmdv6=${pkgs.writeScript "getipv6" '' + #!/bin/sh + set -eo pipefail + ip --oneline address show dev enp7s0 to 2000::/3 primary \ + | awk '{ print $4 }' \ + | cut -d/ -f1 + ''} + ttl=3600 + ''; + }; + systemd.services.ddclient.path = with pkgs; + [ + iproute2 + coreutils + gawk + ]; + system.stateVersion = "23.05"; } -- cgit 1.4.1