# Cloudflare dynamic DNS via NixOS (kissgyorgy/cloudflare-dyndns).
{ config, ... }:
let
  secretFilePath = ../secrets.yaml;
in
{
  sops.secrets."cloudflare-ddns/api-token".sopsFile = secretFilePath;

  services.cloudflare-dyndns = {
    enable = true;
    apiTokenFile = config.sops.secrets."cloudflare-ddns/api-token".path;
    domains = [
      "chiasson.cloud"
      "chiassoncloud.services"
      "swiftshare.cloud"
      "blackfry.day"
      "yestur.day"
      "rp-own.life"
      "慧.cc"
    ];
    proxied = true;
    ipv4 = true;
    ipv6 = false;
    # Default: *:0/5 (every 5 minutes).
  };
}
