git.iko.soy/typeable/nixpkgs
on master help sign in
networking config: specify resolv.conf options as list of strings
commit4e744798078a5e6dd8d58e6632cf657183b3e1ac authorJoachim Fasting <joachifm@fastmail.fm> dateSat 28 May 2016, 13:49 (11 years ago) parent14dfdeb
1 file changed+8−10
nixos/modules/config/networking.nix+8−10
nixos/modules/config/networking.nix+8−10
@@ -11,11 +11,9 @@ let
1111 config.services.dnsmasq.resolveLocalQueries;
1212 hasLocalResolver = config.services.bind.enable || dnsmasqResolve;
1313
14− resolvconfOptions =
15− builtins.replaceStrings ["\n"] [" "]
16− (cfg.resolvconfOptions +
17− (optionalString cfg.dnsSingleRequest " single-request") +
18− (optionalString cfg.dnsExtensionMechanism " ends0"));
14+ resolvconfOptions = cfg.resolvconfOptions
15+ ++ optional cfg.dnsSingleRequest "single-request"
16+ ++ optional cfg.dnsExtensionMechanism "ends0";
1917in
2018
2119{
@@ -65,9 +63,9 @@ in
6563 };
6664
6765 networking.resolvconfOptions = lib.mkOption {
68− type = types.lines;
69− default = "";
70− example = "ndots:1 rotate";
66+ type = types.listOf types.str;
67+ default = [];
68+ example = [ "ndots:1" "rotate" ];
7169 description = ''
7270 Set the options in <filename>/etc/resolv.conf</filename>.
7371 '';
@@ -184,9 +182,9 @@ in
184182 # Invalidate the nscd cache whenever resolv.conf is
185183 # regenerated.
186184 libc_restart='${pkgs.systemd}/bin/systemctl try-restart --no-block nscd.service 2> /dev/null'
187− '' + optionalString ((stringLength resolvconfOptions) > 0) ''
185+ '' + optionalString (length resolvconfOptions > 0) ''
188186 # Options as described in resolv.conf(5)
189− resolv_conf_options='${resolvconfOptions}'
187+ resolv_conf_options='${concatStringsSep " " resolvconfOptions}'
190188 '' + optionalString hasLocalResolver ''
191189 # This hosts runs a full-blown DNS resolver.
192190 name_servers='127.0.0.1'