git.iko.soy/typeable/nixpkgs
on master help sign in
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

commitc730f29e7f14aed4c0ffcdb557676630b0f784a9 authorvolth <volth@webmaster.ms> dateSat 9 Mar 2019, 11:42 (8 years ago) parentb835265
1 file changed+11−9
nixos/modules/tasks/network-interfaces-scripted.nix+11−9
nixos/modules/tasks/network-interfaces-scripted.nix+11−9
@@ -103,16 +103,18 @@ let
103103
104104 script =
105105 ''
106− # Set the static DNS configuration, if given.
107− ${pkgs.openresolv}/sbin/resolvconf -m 1 -a static <<EOF
108− ${optionalString (cfg.nameservers != [] && cfg.domain != null) ''
109− domain ${cfg.domain}
106+ ${optionalString (!config.environment.etc?"resolv.conf") ''
107+ # Set the static DNS configuration, if given.
108+ ${pkgs.openresolv}/sbin/resolvconf -m 1 -a static <<EOF
109+ ${optionalString (cfg.nameservers != [] && cfg.domain != null) ''
110+ domain ${cfg.domain}
111+ ''}
112+ ${optionalString (cfg.search != []) ("search " + concatStringsSep " " cfg.search)}
113+ ${flip concatMapStrings cfg.nameservers (ns: ''
114+ nameserver ${ns}
115+ '')}
116+ EOF
110117 ''}
111− ${optionalString (cfg.search != []) ("search " + concatStringsSep " " cfg.search)}
112− ${flip concatMapStrings cfg.nameservers (ns: ''
113− nameserver ${ns}
114− '')}
115− EOF
116118
117119 # Set the default gateway.
118120 ${optionalString (cfg.defaultGateway != null && cfg.defaultGateway.address != "") ''