{ config, lib, pkgs, ... }:
{
  config = lib.mkIf config.system.webserver.enable {
    services.ddclient = {
      enable = true;
      protocol = "cloudflare";
      zone = "${config.domains.p2}";
      usev6 = "";
      username = "token";
      passwordFile = "${pkgs.writeText "cloudflareapikey" config.secrets.flareApiKey}";
      domains = [
        "${config.domains.p2}"
        "*.${config.domains.p2}"
        "sv.${config.domains.p2}"
        "git.${config.domains.p2}"
        "turn.${config.domains.p2}"
        "dew.${config.domains.p2}"
        "john.${config.domains.p2}"
        "rogue.${config.domains.p2}"
      ];
    };
    environment.persistence."/persist".directories = [
      "/var/lib/private/ddclient"
    ];
  };
}
