liminix/modules/network/link.nix
Daniel Barlow 31f0213b6f convert network link/address to module-based-service
... and make bridge use it.

We also had to convert bridge back into a pair of services.
Downstreams want to depend on the bridge it self being configured
even if not necessarily all the members are up. e.g. don't want
to break ssh on lan if there's a misconfigured wlan device
2023-08-28 22:02:28 +01:00

16 lines
291 B
Nix

{
liminix
, ifwait
, serviceFns
, lib
}:
{ifname, mtu} :
let
inherit (liminix.services) longrun oneshot;
inherit (lib) concatStringsSep;
name = "${ifname}.link";
up = liminix.networking.ifup name ifname;
in oneshot {
inherit name up;
down = "ip link set down dev ${ifname}";
}