nixos/networkd: respect systemd.network.links also with disabled systemd-networkd
This mirrors the behaviour of systemd - It's udev that parses `.link` files, not `systemd-networkd`. This was originally applied in36ef112a47, but was reverted due to1115959a8dcausing evaluation errors on hydra.
This commit is contained in:
@@ -655,6 +655,31 @@ let
|
||||
), "The IPv6 routing table has not been properly cleaned:\n{}".format(ipv6Residue)
|
||||
'';
|
||||
};
|
||||
# even with disabled networkd, systemd.network.links should work
|
||||
# (as it's handled by udev, not networkd)
|
||||
link = {
|
||||
name = "Link";
|
||||
nodes.client = { pkgs, ... }: {
|
||||
virtualisation.vlans = [ 1 ];
|
||||
networking = {
|
||||
useNetworkd = networkd;
|
||||
useDHCP = false;
|
||||
};
|
||||
systemd.network.links."50-foo" = {
|
||||
matchConfig = {
|
||||
Name = "foo";
|
||||
Driver = "dummy";
|
||||
};
|
||||
linkConfig.MTUBytes = "1442";
|
||||
};
|
||||
};
|
||||
testScript = ''
|
||||
print(client.succeed("ip l add name foo type dummy"))
|
||||
print(client.succeed("stat /etc/systemd/network/50-foo.link"))
|
||||
client.succeed("udevadm settle")
|
||||
assert "mtu 1442" in client.succeed("ip l show dummy0")
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
in mapAttrs (const (attrs: makeTest (attrs // {
|
||||
|
||||
Reference in New Issue
Block a user