|
26 | 26 | set -eou pipefail
|
27 | 27 | '' + lib.concatMapStrings ({ id, mac, ... }: ''
|
28 | 28 | if [ -e /sys/class/net/${id} ]; then
|
29 |
| - ${pkgs.iproute2}/bin/ip link delete '${id}' |
| 29 | + ${lib.getExe' pkgs.iproute2 "ip"} link delete '${id}' |
30 | 30 | fi
|
31 | 31 |
|
32 |
| - ${pkgs.iproute2}/bin/ip tuntap add name '${id}' mode tap user '${user}' ${tapFlags} |
| 32 | + ${lib.getExe' pkgs.iproute2 "ip"} tuntap add name '${id}' mode tap user '${user}' ${tapFlags} |
33 | 33 | '') tapInterfaces;
|
34 | 34 |
|
35 | 35 | tap-down = ''
|
36 | 36 | set -ou pipefail
|
37 | 37 | '' + lib.concatMapStrings ({ id, mac, ... }: ''
|
38 |
| - ${pkgs.iproute2}/bin/ip link delete '${id}' |
| 38 | + ${lib.getExe' pkgs.iproute2 "ip"} link delete '${id}' |
39 | 39 | '') tapInterfaces;
|
40 | 40 | }
|
41 | 41 | ) (
|
|
44 | 44 | set -eou pipefail
|
45 | 45 | '' + lib.concatMapStrings ({ id, mac, macvtap, ... }: ''
|
46 | 46 | if [ -e /sys/class/net/${id} ]; then
|
47 |
| - ${pkgs.iproute2}/bin/ip link delete '${id}' |
| 47 | + ${lib.getExe' pkgs.iproute2 "ip"} link delete '${id}' |
48 | 48 | fi
|
49 |
| - ${pkgs.iproute2}/bin/ip link add link '${macvtap.link}' name '${id}' address '${mac}' type macvtap mode '${macvtap.mode}' |
50 |
| - ${pkgs.iproute2}/bin/ip link set '${id}' allmulticast on |
| 49 | + ${lib.getExe' pkgs.iproute2 "ip"} link add link '${macvtap.link}' name '${id}' address '${mac}' type macvtap mode '${macvtap.mode}' |
| 50 | + ${lib.getExe' pkgs.iproute2 "ip"} link set '${id}' allmulticast on |
51 | 51 | if [ -f "/proc/sys/net/ipv6/conf/${id}/disable_ipv6" ]; then
|
52 | 52 | echo 1 > "/proc/sys/net/ipv6/conf/${id}/disable_ipv6"
|
53 | 53 | fi
|
54 |
| - ${pkgs.iproute2}/bin/ip link set '${id}' up |
| 54 | + ${lib.getExe' pkgs.iproute2 "ip"} link set '${id}' up |
55 | 55 | ${pkgs.coreutils-full}/bin/chown '${user}:${group}' /dev/tap$(< "/sys/class/net/${id}/ifindex")
|
56 | 56 | '') macvtapInterfaces;
|
57 | 57 |
|
58 | 58 | macvtap-down = ''
|
59 | 59 | set -ou pipefail
|
60 | 60 | '' + lib.concatMapStrings ({ id, ... }: ''
|
61 |
| - ${pkgs.iproute2}/bin/ip link delete '${id}' |
| 61 | + ${lib.getExe' pkgs.iproute2 "ip"} link delete '${id}' |
62 | 62 | '') macvtapInterfaces;
|
63 | 63 | }
|
64 | 64 | ) ];
|
|
0 commit comments