about summary refs log tree commit diff
path: root/nixos/modules/config/resolvconf.nix
diff options
context:
space:
mode:
authorGary Guo <gary@garyguo.net>2024-04-08 16:44:33 +0100
committerGary Guo <gary@garyguo.net>2024-04-08 16:45:35 +0100
commiteb91bc05bd9ded4807a42255820a03b61d1f3f21 (patch)
tree82d4a9444402273ffbe523b3db37e90dba9b2251 /nixos/modules/config/resolvconf.nix
parent1dab5d7c779787a13d784b25408345e9fd0675b4 (diff)
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: fc060cc3cb1ceb1825cc015abd16dc0fce326836
Diffstat (limited to 'nixos/modules/config/resolvconf.nix')
-rw-r--r--nixos/modules/config/resolvconf.nix4
1 files changed, 1 insertions, 3 deletions
diff --git a/nixos/modules/config/resolvconf.nix b/nixos/modules/config/resolvconf.nix
index 3b8cc0cb8f42e..4318dc8528a03 100644
--- a/nixos/modules/config/resolvconf.nix
+++ b/nixos/modules/config/resolvconf.nix
@@ -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