nixos/network-interfaces-systemd: support WoL and ProxyARP

This completes support for all `network.interfaces` options.
This commit is contained in:
Martin Weinelt
2025-06-29 06:16:42 +02:00
parent 3fd29d9d28
commit 4dd357b322

View File

@@ -76,7 +76,13 @@ let
interfaceNetworks = mkMerge (
forEach interfaces (i: {
netdevs = mkIf i.virtual ({
links = mkIf i.wakeOnLan.enable {
"40-${i.name}" = {
matchConfig.name = i.name;
linkConfig.WakeOnLan = i.wakeOnLan.policy;
};
};
netdevs = mkIf i.virtual {
"40-${i.name}" = {
netdevConfig = {
Name = i.name;
@@ -86,7 +92,7 @@ let
User = i.virtualOwner;
};
};
});
};
networks."40-${i.name}" = {
name = mkDefault i.name;
DHCP = mkForce (
@@ -164,6 +170,9 @@ let
// optionalAttrs (i.mtu != null) {
MTUBytes = toString i.mtu;
};
bridgeConfig = optionalAttrs i.proxyARP {
ProxyARP = i.proxyARP;
};
};
})
);