mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-23 05:18:27 +01:00
Compare commits
No commits in common. "3df7d8f5f07f655a2e981dea3273ca0288551453" and "100f02a2d84122e49f888766d3e92a5714839eff" have entirely different histories.
3df7d8f5f0
...
100f02a2d8
2 changed files with 34 additions and 25 deletions
|
|
@ -16,29 +16,41 @@ in
|
|||
unbound = {
|
||||
enable = true;
|
||||
|
||||
settings.server = {
|
||||
interface = [ netCfg.overlay.interface ];
|
||||
access-control = [ "${toString netCfg.overlay.networkCidr} allow" ];
|
||||
settings = {
|
||||
server = {
|
||||
interface = [ netCfg.overlay.interface ];
|
||||
access-control = [
|
||||
"${toString netCfg.overlay.networkCidr} allow"
|
||||
];
|
||||
|
||||
local-zone = "\"${netCfg.overlay.domain}.\" static";
|
||||
local-data =
|
||||
let
|
||||
nodeRecords =
|
||||
netCfg.nodes
|
||||
|> lib.map (node: "\"${node.hostName}.${node.overlay.domain}. A ${node.overlay.address}\"");
|
||||
serviceRecords =
|
||||
self.nixosConfigurations
|
||||
|> lib.attrValues
|
||||
|> lib.concatMap (
|
||||
host:
|
||||
host.config.custom.services.caddy.virtualHosts
|
||||
local-zone = "\"${netCfg.overlay.domain}.\" static";
|
||||
local-data =
|
||||
let
|
||||
nodeRecords =
|
||||
netCfg.nodes
|
||||
|> lib.map (node: "\"${node.hostName}.${node.overlay.domain}. A ${node.overlay.address}\"");
|
||||
serviceRecords =
|
||||
self.nixosConfigurations
|
||||
|> lib.attrValues
|
||||
|> lib.map (vHost: vHost.domain)
|
||||
|> lib.filter (domain: self.lib.isPrivateDomain domain)
|
||||
|> lib.map (domain: "\"${domain}. A ${host.config.custom.networking.overlay.address}\"")
|
||||
);
|
||||
in
|
||||
nodeRecords ++ serviceRecords;
|
||||
|> lib.concatMap (
|
||||
host:
|
||||
host.config.custom.services.caddy.virtualHosts
|
||||
|> lib.attrValues
|
||||
|> lib.map (vHost: vHost.domain)
|
||||
|> lib.filter (domain: self.lib.isPrivateDomain domain)
|
||||
|> lib.map (domain: "\"${domain}. A ${host.config.custom.networking.overlay.address}\"")
|
||||
);
|
||||
in
|
||||
nodeRecords ++ serviceRecords;
|
||||
};
|
||||
|
||||
forward-zone = lib.singleton {
|
||||
name = ".";
|
||||
forward-addr = [
|
||||
"1.1.1.1"
|
||||
"8.8.8.8"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -108,10 +108,7 @@ in
|
|||
matchConfig.Name = netCfg.overlay.interface;
|
||||
address = [ netCfg.overlay.cidr ];
|
||||
dns = netCfg.overlay.dnsServers;
|
||||
domains = [
|
||||
netCfg.overlay.domain
|
||||
"~." # Route all DNS traffic to this interface first
|
||||
];
|
||||
domains = [ netCfg.overlay.domain ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue