about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJoachim Fasting <joachifm@fastmail.fm>2016-05-28 13:49:54 +0200
committerJoachim Fasting <joachifm@fastmail.fm>2016-05-28 14:28:13 +0200
commit4e744798078a5e6dd8d58e6632cf657183b3e1ac (patch)
tree9da6b86528fc45127b020eaee09e07d35dcc4be1 /nixos
parent14dfdeb31adb965da1c1f5aa4667eab0043aa51e (diff)
downloadnixlib-4e744798078a5e6dd8d58e6632cf657183b3e1ac.tar
nixlib-4e744798078a5e6dd8d58e6632cf657183b3e1ac.tar.gz
nixlib-4e744798078a5e6dd8d58e6632cf657183b3e1ac.tar.bz2
nixlib-4e744798078a5e6dd8d58e6632cf657183b3e1ac.tar.lz
nixlib-4e744798078a5e6dd8d58e6632cf657183b3e1ac.tar.xz
nixlib-4e744798078a5e6dd8d58e6632cf657183b3e1ac.tar.zst
nixlib-4e744798078a5e6dd8d58e6632cf657183b3e1ac.zip
networking config: specify resolv.conf options as list of strings
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/config/networking.nix18
1 files changed, 8 insertions, 10 deletions
diff --git a/nixos/modules/config/networking.nix b/nixos/modules/config/networking.nix
index ceb9152e6de6..8a2e630a917a 100644
--- a/nixos/modules/config/networking.nix
+++ b/nixos/modules/config/networking.nix
@@ -11,11 +11,9 @@ let
                    config.services.dnsmasq.resolveLocalQueries;
   hasLocalResolver = config.services.bind.enable || dnsmasqResolve;
 
-  resolvconfOptions =
-    builtins.replaceStrings ["\n"] [" "]
-      (cfg.resolvconfOptions +
-      (optionalString cfg.dnsSingleRequest " single-request") +
-      (optionalString cfg.dnsExtensionMechanism " ends0"));
+  resolvconfOptions = cfg.resolvconfOptions
+    ++ optional cfg.dnsSingleRequest "single-request"
+    ++ optional cfg.dnsExtensionMechanism "ends0";
 in
 
 {
@@ -65,9 +63,9 @@ in
     };
 
     networking.resolvconfOptions = lib.mkOption {
-      type = types.lines;
-      default = "";
-      example = "ndots:1 rotate";
+      type = types.listOf types.str;
+      default = [];
+      example = [ "ndots:1" "rotate" ];
       description = ''
         Set the options in <filename>/etc/resolv.conf</filename>.
       '';
@@ -184,9 +182,9 @@ in
               # Invalidate the nscd cache whenever resolv.conf is
               # regenerated.
               libc_restart='${pkgs.systemd}/bin/systemctl try-restart --no-block nscd.service 2> /dev/null'
-            '' + optionalString ((stringLength resolvconfOptions) > 0) ''
+            '' + optionalString (length resolvconfOptions > 0) ''
               # Options as described in resolv.conf(5)
-              resolv_conf_options='${resolvconfOptions}'
+              resolv_conf_options='${concatStringsSep " " resolvconfOptions}'
             '' + optionalString hasLocalResolver ''
               # This hosts runs a full-blown DNS resolver.
               name_servers='127.0.0.1'