diff options
| author | Mel <mel@rnrd.eu> | 2026-09-05 19:01:16 +0200 |
|---|---|---|
| committer | Mel <mel@rnrd.eu> | 2026-09-06 06:12:02 +0200 |
| commit | 0df4a7d25021d2d5c92e447f2838ec920d49167b (patch) | |
| tree | a659ff8ecf7ed7eabf1b539d6651722ebe7009ac /modules | |
| parent | fa49e4a5d8ec8287fbd51046c26a84e8c99a4ec5 (diff) | |
| download | network-0df4a7d25021d2d5c92e447f2838ec920d49167b.tar.zst network-0df4a7d25021d2d5c92e447f2838ec920d49167b.zip | |
Use my own DDNS service 'ddnnss' instead of deprecated ddclient
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/ddns.nix | 48 |
1 files changed, 28 insertions, 20 deletions
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"; + }; + }; }; } |
