# /nix/store/<hash>/ddclient.conf
{ config, common, ... }:
let
  domain = common.domain;
  cloudflarePasswordKey = "cloudflare/api-token";
in
{
  services.ddclient = {
    enable = true;
    protocol = "cloudflare";
    username = "emberal+cloudflare@pm.me";
    passwordFile = config.sops.secrets.${cloudflarePasswordKey}.path;
    zone = domain;
    domains = [
      domain
      "*.${domain}"
    ];
  };

  sops.secrets.${cloudflarePasswordKey} = { };
}
