refactor: trust-dns: listenAddrs -> listenAddrsIpv4
This commit is contained in:
parent
e040a5b0c5
commit
d5e8974a4a
|
@ -96,24 +96,24 @@ in
|
||||||
{
|
{
|
||||||
wan = {
|
wan = {
|
||||||
substitutions = mkSubstitutions "wan";
|
substitutions = mkSubstitutions "wan";
|
||||||
listenAddrs = [
|
listenAddrsIpv4 = [
|
||||||
nativeAddrs."servo.lan"
|
nativeAddrs."servo.lan"
|
||||||
bindOvpn
|
bindOvpn
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
lan = {
|
lan = {
|
||||||
substitutions = mkSubstitutions "lan";
|
substitutions = mkSubstitutions "lan";
|
||||||
listenAddrs = [ nativeAddrs."servo.lan" ];
|
listenAddrsIpv4 = [ nativeAddrs."servo.lan" ];
|
||||||
port = 1053;
|
port = 1053;
|
||||||
};
|
};
|
||||||
hn = {
|
hn = {
|
||||||
substitutions = mkSubstitutions "hn";
|
substitutions = mkSubstitutions "hn";
|
||||||
listenAddrs = [ nativeAddrs."servo.hn" ];
|
listenAddrsIpv4 = [ nativeAddrs."servo.hn" ];
|
||||||
port = 1053;
|
port = 1053;
|
||||||
};
|
};
|
||||||
# hn-resolver = {
|
# hn-resolver = {
|
||||||
# # don't need %AWAN% here because we forward to the hn instance.
|
# # don't need %AWAN% here because we forward to the hn instance.
|
||||||
# listenAddrs = [ nativeAddrs."servo.hn" ];
|
# listenAddrsIpv4 = [ nativeAddrs."servo.hn" ];
|
||||||
# extraConfig = {
|
# extraConfig = {
|
||||||
# zones = [
|
# zones = [
|
||||||
# {
|
# {
|
||||||
|
|
|
@ -13,7 +13,7 @@ let
|
||||||
type = types.port;
|
type = types.port;
|
||||||
default = 53;
|
default = 53;
|
||||||
};
|
};
|
||||||
listenAddrs = mkOption {
|
listenAddrsIpv4 = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
default = [ "127.0.0.1" ];
|
default = [ "127.0.0.1" ];
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -78,13 +78,13 @@ let
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
mkSystemdService = flavor: { includes, listenAddrs, port, substitutions, extraConfig, ... }: let
|
mkSystemdService = flavor: { includes, listenAddrsIpv4, port, substitutions, extraConfig, ... }: let
|
||||||
sed = "${pkgs.gnused}/bin/sed";
|
sed = "${pkgs.gnused}/bin/sed";
|
||||||
configTemplate = toml.generate "trust-dns-${flavor}.toml" (
|
configTemplate = toml.generate "trust-dns-${flavor}.toml" (
|
||||||
(
|
(
|
||||||
lib.filterAttrsRecursive (_: v: v != null) config.services.trust-dns.settings
|
lib.filterAttrsRecursive (_: v: v != null) config.services.trust-dns.settings
|
||||||
) // {
|
) // {
|
||||||
listen_addrs_ipv4 = listenAddrs;
|
listen_addrs_ipv4 = listenAddrsIpv4;
|
||||||
} // extraConfig
|
} // extraConfig
|
||||||
);
|
);
|
||||||
configPath = "/var/lib/trust-dns/${flavor}-config.toml";
|
configPath = "/var/lib/trust-dns/${flavor}-config.toml";
|
||||||
|
@ -211,7 +211,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
sane.services.trust-dns.instances.localhost = lib.mkIf cfg.asSystemResolver {
|
sane.services.trust-dns.instances.localhost = lib.mkIf cfg.asSystemResolver {
|
||||||
listenAddrs = [ "127.0.0.1" ];
|
listenAddrsIpv4 = [ "127.0.0.1" ];
|
||||||
enableRecursiveResolver = true;
|
enableRecursiveResolver = true;
|
||||||
# append zones discovered via DHCP to the resolver config.
|
# append zones discovered via DHCP to the resolver config.
|
||||||
includes = [ "/var/lib/trust-dns/dhcp-configs/*" ];
|
includes = [ "/var/lib/trust-dns/dhcp-configs/*" ];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user