Skip to content

Commit 84ac225

Browse files
committed
nixos-modules/microvm/interfaces: use lib.getExe' iproute2
1 parent 0308cc2 commit 84ac225

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

nixos-modules/microvm/interfaces.nix

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ in
2626
set -eou pipefail
2727
'' + lib.concatMapStrings ({ id, mac, ... }: ''
2828
if [ -e /sys/class/net/${id} ]; then
29-
${pkgs.iproute2}/bin/ip link delete '${id}'
29+
${lib.getExe' pkgs.iproute2 "ip"} link delete '${id}'
3030
fi
3131
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}
3333
'') tapInterfaces;
3434

3535
tap-down = ''
3636
set -ou pipefail
3737
'' + lib.concatMapStrings ({ id, mac, ... }: ''
38-
${pkgs.iproute2}/bin/ip link delete '${id}'
38+
${lib.getExe' pkgs.iproute2 "ip"} link delete '${id}'
3939
'') tapInterfaces;
4040
}
4141
) (
@@ -44,21 +44,21 @@ in
4444
set -eou pipefail
4545
'' + lib.concatMapStrings ({ id, mac, macvtap, ... }: ''
4646
if [ -e /sys/class/net/${id} ]; then
47-
${pkgs.iproute2}/bin/ip link delete '${id}'
47+
${lib.getExe' pkgs.iproute2 "ip"} link delete '${id}'
4848
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
5151
if [ -f "/proc/sys/net/ipv6/conf/${id}/disable_ipv6" ]; then
5252
echo 1 > "/proc/sys/net/ipv6/conf/${id}/disable_ipv6"
5353
fi
54-
${pkgs.iproute2}/bin/ip link set '${id}' up
54+
${lib.getExe' pkgs.iproute2 "ip"} link set '${id}' up
5555
${pkgs.coreutils-full}/bin/chown '${user}:${group}' /dev/tap$(< "/sys/class/net/${id}/ifindex")
5656
'') macvtapInterfaces;
5757

5858
macvtap-down = ''
5959
set -ou pipefail
6060
'' + lib.concatMapStrings ({ id, ... }: ''
61-
${pkgs.iproute2}/bin/ip link delete '${id}'
61+
${lib.getExe' pkgs.iproute2 "ip"} link delete '${id}'
6262
'') macvtapInterfaces;
6363
}
6464
) ];

0 commit comments

Comments
 (0)