diff --git a/modules/caddy-proxy/default.nix b/modules/caddy-proxy/default.nix index 2078485..969e005 100644 --- a/modules/caddy-proxy/default.nix +++ b/modules/caddy-proxy/default.nix @@ -22,11 +22,18 @@ let }; }; + cloudflare-tls = '' + tls { + dns cloudflare {env.CF_API_TOKEN} + propagation_timeout -1 + } + ''; + mkProxyHost = target: { extraConfig = '' reverse_proxy ${target} - import cloudflare-tls + ${cloudflare-tls} ''; }; @@ -42,7 +49,7 @@ let error "Nope." 403 } - import cloudflare-tls + ${cloudflare-tls} ''; }; in @@ -65,14 +72,7 @@ in acmeCA = "https://acme-v02.api.letsencrypt.org/directory"; - extraConfig = '' - (cloudflare-tls) { - tls { - dns cloudflare {env.CF_API_TOKEN} - propagation_timeout -1 - } - } - ''; + extraConfig = ''''; virtualHosts = builtins.listToAttrs ( map (