about summary refs log tree commit diff
path: root/nixos/modules/tasks/network-interfaces-scripted.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/tasks/network-interfaces-scripted.nix')
-rw-r--r--nixos/modules/tasks/network-interfaces-scripted.nix6
1 files changed, 3 insertions, 3 deletions
diff --git a/nixos/modules/tasks/network-interfaces-scripted.nix b/nixos/modules/tasks/network-interfaces-scripted.nix
index 34f0cbabc3b4..a994e44c6ecf 100644
--- a/nixos/modules/tasks/network-interfaces-scripted.nix
+++ b/nixos/modules/tasks/network-interfaces-scripted.nix
@@ -66,7 +66,7 @@ in
             serviceConfig.RemainAfterExit = true;
 
             script =
-              (optionalString (!config.services.resolved.enable) ''
+              ''
                 # Set the static DNS configuration, if given.
                 ${pkgs.openresolv}/sbin/resolvconf -m 1 -a static <<EOF
                 ${optionalString (cfg.nameservers != [] && cfg.domain != null) ''
@@ -77,9 +77,9 @@ in
                   nameserver ${ns}
                 '')}
                 EOF
-              '') + ''
+
                 # Set the default gateway.
-                ${optionalString (cfg.defaultGateway != null) ''
+                ${optionalString (cfg.defaultGateway != null && cfg.defaultGateway != "") ''
                   # FIXME: get rid of "|| true" (necessary to make it idempotent).
                   ip route add default via "${cfg.defaultGateway}" ${
                     optionalString (cfg.defaultGatewayWindowSize != null)