Browse Source

nixos-module/container/dnscache: use data from config.site.dns.localZones

master
Astro 1 month ago
parent
commit
a45fb3c484
1 changed files with 8 additions and 31 deletions
  1. 8
    31
      nix/nixos-module/container/dnscache.nix

+ 8
- 31
nix/nixos-module/container/dnscache.nix View File

@@ -73,37 +73,14 @@ lib.mkIf config.site.hosts.${hostName}.services.dnscache.enable {
73 73
 
74 74
       # Local networks
75 75
 
76
-      forward-zone:
77
-        name: "zentralwerk.dn42"
78
-        forward-host: "dns.serv.zentralwerk.org"
79
-
80
-      forward-zone:
81
-        name: "72.20.172.in-addr.arpa"
82
-        forward-host: "dns.serv.zentralwerk.org"
83
-
84
-      forward-zone:
85
-        name: "73.20.172.in-addr.arpa"
86
-        forward-host: "dns.serv.zentralwerk.org"
87
-
88
-      forward-zone:
89
-        name: "74.20.172.in-addr.arpa"
90
-        forward-host: "dns.serv.zentralwerk.org"
91
-
92
-      forward-zone:
93
-        name: "75.20.172.in-addr.arpa"
94
-        forward-host: "dns.serv.zentralwerk.org"
95
-
96
-      forward-zone:
97
-        name: "76.20.172.in-addr.arpa"
98
-        forward-host: "dns.serv.zentralwerk.org"
99
-
100
-      forward-zone:
101
-        name: "77.20.172.in-addr.arpa"
102
-        forward-host: "dns.serv.zentralwerk.org"
103
-
104
-      forward-zone:
105
-        name: "0.0.5.0.2.d.3.c.4.2.0.0.3.2.d.f.ip6.arpa"
106
-        forward-host: "dns.serv.zentralwerk.org"
76
+      ${lib.concatMapStrings ({ name, ... }: ''
77
+        forward-zone:
78
+          name: "${name}"
79
+          forward-host: "${config.site.net.serv.hosts4.dns}"
80
+        ${lib.concatMapStrings (hosts6:
81
+          "  forward-host: ${hosts6.dns}\n"
82
+        ) (builtins.attrValues config.site.net.serv.hosts6)}
83
+      '') config.site.dns.localZones}
107 84
 
108 85
       # C3D2 reverse
109 86
 

Loading…
Cancel
Save