mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 12:29:02 +02:00
refactor: combine scripted and networkd WakeOnLan config
This commit is contained in:
parent
d290c309f4
commit
f5f1751b1f
|
@ -61,8 +61,6 @@ let
|
|||
MACAddress = i.macAddress;
|
||||
} // optionalAttrs (i.mtu != null) {
|
||||
MTUBytes = toString i.mtu;
|
||||
} // optionalAttrs (i.wakeOnLan.enable == true) {
|
||||
WakeOnLan = concatStringsSep " " i.wakeOnLan.policy;
|
||||
};
|
||||
};
|
||||
in listToAttrs (map createNetworkLink interfaces);
|
||||
|
|
|
@ -389,16 +389,6 @@ in
|
|||
};
|
||||
})))
|
||||
vlanNetworks
|
||||
{
|
||||
systemd.network.links = pipe interfaces [
|
||||
(filter (i: i.wakeOnLan.enable))
|
||||
(map (i: nameValuePair "40-${i.name}" {
|
||||
matchConfig.OriginalName = i.name;
|
||||
linkConfig.WakeOnLan = concatStringsSep " " i.wakeOnLan.policy;
|
||||
}))
|
||||
listToAttrs
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
# We need to prefill the slaved devices with networking options
|
||||
|
|
|
@ -1460,6 +1460,16 @@ in
|
|||
]
|
||||
++ bridgeStp;
|
||||
|
||||
# Wake-on-LAN configuration is shared by the scripted and networkd backends.
|
||||
systemd.network.links = pipe interfaces [
|
||||
(filter (i: i.wakeOnLan.enable))
|
||||
(map (i: nameValuePair "40-${i.name}" {
|
||||
matchConfig.OriginalName = i.name;
|
||||
linkConfig.WakeOnLan = concatStringsSep " " i.wakeOnLan.policy;
|
||||
}))
|
||||
listToAttrs
|
||||
];
|
||||
|
||||
# The network-interfaces target is kept for backwards compatibility.
|
||||
# New modules must NOT use it.
|
||||
systemd.targets.network-interfaces =
|
||||
|
|
Loading…
Reference in a new issue