diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2019-12-08 02:27:25 +0100 |
---|---|---|
committer | Maximilian Bosch <maximilian@mbosch.me> | 2019-12-08 03:30:04 +0100 |
commit | ff65638bfc39898bd15170336647e8b7442e25af (patch) | |
tree | 8fe86a63325ab0ed2e0aba0cf85baa55850d831c | |
parent | 536879193731a5e52a431b62d8d147a5b73dcebb (diff) | |
download | nixpkgs-ff65638bfc39898bd15170336647e8b7442e25af.tar nixpkgs-ff65638bfc39898bd15170336647e8b7442e25af.tar.gz nixpkgs-ff65638bfc39898bd15170336647e8b7442e25af.tar.bz2 nixpkgs-ff65638bfc39898bd15170336647e8b7442e25af.tar.lz nixpkgs-ff65638bfc39898bd15170336647e8b7442e25af.tar.xz nixpkgs-ff65638bfc39898bd15170336647e8b7442e25af.tar.zst nixpkgs-ff65638bfc39898bd15170336647e8b7442e25af.zip |
nixos/networkd: only set gateway if it's explicitly specified in the module system
-rw-r--r-- | nixos/modules/tasks/network-interfaces-systemd.nix | 4 |
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 [ { |