Merge pull request #75193 from Ma27/optional-networkd-gateway

nixos/networkd: only set gateway if it's explicitly specified in the module system
This commit is contained in:
Franz Pletz 2019-12-15 22:15:32 +00:00 committed by GitHub
commit 0f783bc7ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 [
{