vlans and mt300a wired network interfaces

This commit is contained in:
Daniel Barlow 2023-03-07 19:10:12 +00:00
parent 06687a819a
commit e86e9430fc
2 changed files with 28 additions and 1 deletions

View file

@ -8,11 +8,13 @@ let
inherit (liminix.services) oneshot longrun;
inherit (lib) concatStringsSep optional;
in {
interface = { type ? "hardware", device, primary ? null, dependencies ? [] } @ args:
interface = { type ? "hardware", device, link ? null, primary ? null, id ? null, dependencies ? [] } @ args:
let ups =
[]
++ optional (type == "bridge")
"ip link add name ${device} type bridge"
++ optional (type == "vlan")
"ip link add link ${link} name ${device} type vlan id ${id}"
++ ["${ifwait}/bin/ifwait -v ${device} present"]
++ ["ip link set up dev ${device}"]
++ optional (primary != null)