liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

service.nix (381B)


      1 {
      2   liminix
      3 , lib
      4 }:
      5 { ifname, primary, vid } :
      6 let
      7   inherit (liminix.services) oneshot;
      8 in oneshot rec {
      9   name = "${ifname}.link";
     10   up = ''
     11     ip link add link $(output ${primary} ifname) name ${ifname} type vlan id ${vid}
     12     ${liminix.networking.ifup name ifname}
     13     (in_outputs ${name}
     14      echo ${ifname} > ifname
     15     )
     16   '';
     17   down = "ip link set down dev ${ifname}";
     18 }