about summary refs log tree commit diff
path: root/nixos/modules/tasks
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-04-13 15:18:59 +0200
committerFlorian Klink <flokli@flokli.de>2020-04-13 22:03:35 +0200
commitcddc7a28b825af49d6d1f8b6d34122e98d3f4c1e (patch)
treed8bb25bef6139c89a457945f2169234291b4ee84 /nixos/modules/tasks
parentad06ae4195dbc680c5a30f11df90cf212e7f864f (diff)
downloadnixlib-cddc7a28b825af49d6d1f8b6d34122e98d3f4c1e.tar
nixlib-cddc7a28b825af49d6d1f8b6d34122e98d3f4c1e.tar.gz
nixlib-cddc7a28b825af49d6d1f8b6d34122e98d3f4c1e.tar.bz2
nixlib-cddc7a28b825af49d6d1f8b6d34122e98d3f4c1e.tar.lz
nixlib-cddc7a28b825af49d6d1f8b6d34122e98d3f4c1e.tar.xz
nixlib-cddc7a28b825af49d6d1f8b6d34122e98d3f4c1e.tar.zst
nixlib-cddc7a28b825af49d6d1f8b6d34122e98d3f4c1e.zip
nixos/networking: fix setting .macAddress and .mtu with networkd
This needs to be set in the .linkConfig of a .network
Diffstat (limited to 'nixos/modules/tasks')
-rw-r--r--nixos/modules/tasks/network-interfaces-systemd.nix7
1 files changed, 6 insertions, 1 deletions
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}" = {