summary refs log tree commit diff stats
path: root/system/prefect.nix
diff options
context:
space:
mode:
Diffstat (limited to 'system/prefect.nix')
-rw-r--r--system/prefect.nix35
1 files changed, 35 insertions, 0 deletions
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";
 }