From cddc7a28b825af49d6d1f8b6d34122e98d3f4c1e Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 13 Apr 2020 15:18:59 +0200 Subject: [PATCH] nixos/networking: fix setting .macAddress and .mtu with networkd This needs to be set in the .linkConfig of a .network --- nixos/modules/tasks/network-interfaces-systemd.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nixos/modules/tasks/network-interfaces-systemd.nix b/nixos/modules/tasks/network-interfaces-systemd.nix index 41deceb000e6..23e1e611a71e 100644 --- a/nixos/modules/tasks/network-interfaces-systemd.nix +++ b/nixos/modules/tasks/network-interfaces-systemd.nix @@ -94,7 +94,12 @@ in address = forEach (interfaceIps i) (ip: "${ip.address}/${toString ip.prefixLength}"); networkConfig.IPv6PrivacyExtensions = "kernel"; - } ]; + linkConfig = optionalAttrs (i.macAddress != null) { + MACAddress = i.macAddress; + } // optionalAttrs (i.mtu != null) { + MTUBytes = toString i.mtu; + }; + }]; }))) (mkMerge (flip mapAttrsToList cfg.bridges (name: bridge: { netdevs."40-${name}" = {