network-scripting: do not run resolvconf if /etc/resolv.conf is managed manually (#56682)

The second invocation of resolvconf, missed in https://github.com/NixOS/nixpkgs/pull/32308
This commit is contained in:
volth 2019-03-09 11:42:14 +00:00 committed by Danylo Hlynskyi
parent b8352653ac
commit c730f29e7f

View File

@ -103,16 +103,18 @@ let
script = script =
'' ''
# Set the static DNS configuration, if given. ${optionalString (!config.environment.etc?"resolv.conf") ''
${pkgs.openresolv}/sbin/resolvconf -m 1 -a static <<EOF # Set the static DNS configuration, if given.
${optionalString (cfg.nameservers != [] && cfg.domain != null) '' ${pkgs.openresolv}/sbin/resolvconf -m 1 -a static <<EOF
domain ${cfg.domain} ${optionalString (cfg.nameservers != [] && cfg.domain != null) ''
domain ${cfg.domain}
''}
${optionalString (cfg.search != []) ("search " + concatStringsSep " " cfg.search)}
${flip concatMapStrings cfg.nameservers (ns: ''
nameserver ${ns}
'')}
EOF
''} ''}
${optionalString (cfg.search != []) ("search " + concatStringsSep " " cfg.search)}
${flip concatMapStrings cfg.nameservers (ns: ''
nameserver ${ns}
'')}
EOF
# Set the default gateway. # Set the default gateway.
${optionalString (cfg.defaultGateway != null && cfg.defaultGateway.address != "") '' ${optionalString (cfg.defaultGateway != null && cfg.defaultGateway.address != "") ''