summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/ddns.nix48
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";
+ };
+ };
};
}