nixos/resolvconf: fix useLocalResolver when IPv6 is enabled

resolvconf.conf is a shell script and unlike resolv.conf, multiple
nameservers are specified by space separating them instead of adding
multiple lines.

Fixes: fc060cc3cb
This commit is contained in:
Gary Guo 2024-04-08 16:44:33 +01:00
parent 1dab5d7c77
commit eb91bc05bd
1 changed files with 1 additions and 3 deletions

View File

@ -27,9 +27,7 @@ let
resolv_conf_options='${concatStringsSep " " resolvconfOptions}'
'' + optionalString cfg.useLocalResolver ''
# This hosts runs a full-blown DNS resolver.
name_servers='127.0.0.1'
'' + optionalString (cfg.useLocalResolver && config.networking.enableIPv6) ''
name_servers='::1'
name_servers='127.0.0.1${optionalString config.networking.enableIPv6 " ::1"}'
'' + cfg.extraConfig;
in