summaryrefslogtreecommitdiff
path: root/ext/terranix/cloudflare/dns.nix
diff options
context:
space:
mode:
Diffstat (limited to 'ext/terranix/cloudflare/dns.nix')
-rw-r--r--ext/terranix/cloudflare/dns.nix78
1 files changed, 43 insertions, 35 deletions
diff --git a/ext/terranix/cloudflare/dns.nix b/ext/terranix/cloudflare/dns.nix
index 4da90ab..4be834c 100644
--- a/ext/terranix/cloudflare/dns.nix
+++ b/ext/terranix/cloudflare/dns.nix
@@ -1,52 +1,60 @@
-{lib, ...}: let
- mkRecord = {
- name,
- value,
- type,
- zone_id,
- }:
+{ lib, ... }:
+let
+ mkRecord =
{
- inherit name value type zone_id;
+ name,
+ value,
+ type,
+ zone_id,
+ }:
+ {
+ inherit
+ name
+ value
+ type
+ zone_id
+ ;
ttl = 1;
}
- // lib.optionalAttrs (type != "TXT") {proxied = true;};
+ // lib.optionalAttrs (type != "TXT") { proxied = true; };
zones = {
getchoo_com = lib.tfRef "var.getchoo_com_zone_id";
};
- inherit
- (zones)
- getchoo_com
- ;
+ inherit (zones) getchoo_com;
atlas_tunnel = lib.tfRef "data.cloudflare_tunnel.atlas-nginx.id" + ".cfargotunnel.com";
pagesSubdomainFor = project: lib.tfRef "resource.cloudflare_pages_project.${project}.subdomain";
- blockEmailSpoofingFor = domain: let
- zone_id = zones.${domain};
- in {
- "${domain}_dmarc" = {
- name = "_dmarc";
- value = "v=DMARC1; p=reject; sp=reject; adkim=s; aspf=s;";
- type = "TXT";
- inherit zone_id;
- };
+ blockEmailSpoofingFor =
+ domain:
+ let
+ zone_id = zones.${domain};
+ in
+ {
+ "${domain}_dmarc" = {
+ name = "_dmarc";
+ value = "v=DMARC1; p=reject; sp=reject; adkim=s; aspf=s;";
+ type = "TXT";
+ inherit zone_id;
+ };
- "${domain}_domainkey" = {
- name = "*._domainkey";
- value = "v=DKIM1; p=";
- type = "TXT";
- inherit zone_id;
- };
+ "${domain}_domainkey" = {
+ name = "*._domainkey";
+ value = "v=DKIM1; p=";
+ type = "TXT";
+ inherit zone_id;
+ };
- "${domain}_email" = {
- name = "@";
- value = "v=spf1 -all";
- type = "TXT";
- inherit zone_id;
+ "${domain}_email" = {
+ name = "@";
+ value = "v=spf1 -all";
+ type = "TXT";
+ inherit zone_id;
+ };
};
- };
-in {
+in
+{
resource.cloudflare_zone_dnssec = {
getchoo_com_dnssec = {
zone_id = getchoo_com;