summary refs log tree commit diff
path: root/nixos/modules/tasks
diff options
context:
space:
mode:
authorFranz Pletz <fpletz@fnordicwalking.de>2019-12-15 22:15:32 +0000
committerGitHub <noreply@github.com>2019-12-15 22:15:32 +0000
commit0f783bc7ca08766fef2d059093274051c097a6a9 (patch)
tree9e3994c8e394d235226a834c7d669b3f8dcb16f8 /nixos/modules/tasks
parentd7125bf6b6d81bc3139aa742e195d3fa82855170 (diff)
parentff65638bfc39898bd15170336647e8b7442e25af (diff)
downloadnixpkgs-0f783bc7ca08766fef2d059093274051c097a6a9.tar
nixpkgs-0f783bc7ca08766fef2d059093274051c097a6a9.tar.gz
nixpkgs-0f783bc7ca08766fef2d059093274051c097a6a9.tar.bz2
nixpkgs-0f783bc7ca08766fef2d059093274051c097a6a9.tar.lz
nixpkgs-0f783bc7ca08766fef2d059093274051c097a6a9.tar.xz
nixpkgs-0f783bc7ca08766fef2d059093274051c097a6a9.tar.zst
nixpkgs-0f783bc7ca08766fef2d059093274051c097a6a9.zip
Merge pull request #75193 from Ma27/optional-networkd-gateway
nixos/networkd: only set gateway if it's explicitly specified in the module system
Diffstat (limited to 'nixos/modules/tasks')
-rw-r--r--nixos/modules/tasks/network-interfaces-systemd.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/tasks/network-interfaces-systemd.nix b/nixos/modules/tasks/network-interfaces-systemd.nix
index 9ffa1089ee6..e25dc0c0b39 100644
--- a/nixos/modules/tasks/network-interfaces-systemd.nix
+++ b/nixos/modules/tasks/network-interfaces-systemd.nix
@@ -60,8 +60,8 @@ in
       let
         domains = cfg.search ++ (optional (cfg.domain != null) cfg.domain);
         genericNetwork = override:
-          let gateway = optional (cfg.defaultGateway != null) cfg.defaultGateway.address
-            ++ optional (cfg.defaultGateway6 != null) cfg.defaultGateway6.address;
+          let gateway = optional (cfg.defaultGateway != null && (cfg.defaultGateway.address or "") != "") cfg.defaultGateway.address
+            ++ optional (cfg.defaultGateway6 != null && (cfg.defaultGateway6.address or "") != "") cfg.defaultGateway6.address;
           in optionalAttrs (gateway != [ ]) {
             routes = override [
               {