2023-08-30 22:26:44 +00:00
|
|
|
{
|
2025-02-10 21:55:08 +00:00
|
|
|
liminix,
|
|
|
|
lib,
|
|
|
|
}:
|
|
|
|
{
|
|
|
|
ifname,
|
|
|
|
primary,
|
|
|
|
vid,
|
2023-08-30 22:26:44 +00:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
inherit (liminix.services) oneshot;
|
2025-02-10 21:55:08 +00:00
|
|
|
in
|
|
|
|
oneshot rec {
|
2023-08-30 22:26:44 +00:00
|
|
|
name = "${ifname}.link";
|
|
|
|
up = ''
|
|
|
|
ip link add link $(output ${primary} ifname) name ${ifname} type vlan id ${vid}
|
|
|
|
${liminix.networking.ifup name ifname}
|
2023-09-15 20:45:00 +00:00
|
|
|
(in_outputs ${name}
|
|
|
|
echo ${ifname} > ifname
|
|
|
|
)
|
2023-08-30 22:26:44 +00:00
|
|
|
'';
|
|
|
|
down = "ip link set down dev ${ifname}";
|
2024-04-28 20:33:36 +00:00
|
|
|
dependencies = [ primary ];
|
2023-08-30 22:26:44 +00:00
|
|
|
}
|