From 0df4a7d25021d2d5c92e447f2838ec920d49167b Mon Sep 17 00:00:00 2001 From: Mel Date: Sat, 5 Sep 2026 19:01:16 +0200 Subject: Use my own DDNS service 'ddnnss' instead of deprecated ddclient Signed-off-by: Mel --- modules/ddns.nix | 48 ++++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-) (limited to 'modules/ddns.nix') diff --git a/modules/ddns.nix b/modules/ddns.nix index 253e3e4..0253d69 100644 --- a/modules/ddns.nix +++ b/modules/ddns.nix @@ -1,34 +1,42 @@ -{ me, config, ... }: +{ me, config, ddnnss, ... }: let domain = "rnrd.eu"; in { - age.secrets.cloudflare-dns = { - file = ../secrets/cloudflare-dns.age; + imports = [ ddnnss.nixosModules.default ]; + + age.secrets.bunny-dns = { + file = ../secrets/bunny-dns.age; }; - services.ddclient = { + services.ddnnss = { enable = true; + interval = "30min"; - # Cloudflare DNS API parameters + credentials = { + bunny-dns = config.age.secrets.bunny-dns.path; + }; - # dyn.com no longer supports HTTPS :( - # See: https://github.com/ddclient/ddclient/issues/597 - usev6 = "webv6, webv6=ipv6.icanhazip.com/"; - protocol = "cloudflare"; + settings = { + records = [ + { + zone = domain; + name = me.name; + type = "AAAA"; + provider = "bunny"; + source = "icanhazip"; + } + ]; - username = "token"; - zone = domain; - domains = [ "${me.name}.${domain}" ]; - passwordFile = config.age.secrets.cloudflare-dns.path; - }; + providers.bunny = { + kind = "bunny"; + keyFile = "$CREDENTIALS_DIRECTORY/bunny-dns"; + }; - systemd.services.ddclient = { - # ddclient likes failing the whole process when - # one part of the operation did not succeed, like - # setting the A record, which i do not want anyway. - # treat these failures as a success: - serviceConfig.SuccessExitStatus = [ 0 1 ]; + sources.icanhazip = { + kind = "icanhazip"; + }; + }; }; } -- cgit v1.3.1