Resolve tinc hosts with subdomains too
This commit is contained in:
parent
b1db7229cd
commit
f0807443fd
|
@ -23,10 +23,13 @@ in
|
||||||
hosts;
|
hosts;
|
||||||
|
|
||||||
# Add all of them to host
|
# Add all of them to host
|
||||||
networking.extraHosts = lib.strings.concatStringsSep
|
nki.services.edns = {
|
||||||
"\n"
|
enable = true;
|
||||||
(lib.attrsets.mapAttrsToList
|
cloaking-rules =
|
||||||
(name: host: "${host.subnetAddr} ${name}.tinc")
|
(lib.attrsets.mapAttrs'
|
||||||
hosts);
|
(name: host: { name = "${name}.tinc"; value = host.subnetAddr; })
|
||||||
|
hosts)
|
||||||
|
;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,11 @@ in
|
||||||
options.nki.services.edns = {
|
options.nki.services.edns = {
|
||||||
enable = mkEnableOption "Enable encrypted DNS";
|
enable = mkEnableOption "Enable encrypted DNS";
|
||||||
ipv6 = mkEnableOption "Enable ipv6";
|
ipv6 = mkEnableOption "Enable ipv6";
|
||||||
|
cloaking-rules = mkOption {
|
||||||
|
type = types.attrsOf types.str;
|
||||||
|
default = { };
|
||||||
|
description = "A set of domain -> ip mapping for cloaking_rules";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
@ -42,6 +47,11 @@ in
|
||||||
{ server_name = "*"; via = [ "anon-plan9-dns" "anon-v.dnscrypt.up-ipv4" ]; }
|
{ server_name = "*"; via = [ "anon-plan9-dns" "anon-v.dnscrypt.up-ipv4" ]; }
|
||||||
];
|
];
|
||||||
anonymized_dns.skip_incompatible = true;
|
anonymized_dns.skip_incompatible = true;
|
||||||
|
|
||||||
|
# Cloaking rules
|
||||||
|
cloaking_rules = pkgs.writeText "cloaking_rules.txt" (lib.strings.concatStringsSep
|
||||||
|
"\n"
|
||||||
|
(lib.attrsets.mapAttrsToList (name: ip: "${name} ${ip}") cfg.cloaking-rules));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue