diff --git a/modules/nixos/services/vpn/wireguard/client.nix b/modules/nixos/services/vpn/wireguard/client.nix index 14868e1..32661ec 100644 --- a/modules/nixos/services/vpn/wireguard/client.nix +++ b/modules/nixos/services/vpn/wireguard/client.nix @@ -54,7 +54,7 @@ in addr=`${pkgs.iproute}/bin/ip route | ${pkgs.gawk}/bin/awk '/default/ {print $3; exit}'` interface=`${pkgs.iproute}/bin/ip route | ${pkgs.gawk}/bin/awk '/default/ {print $5; exit}'` '' + lib.concatLines (map - (addr: "${pkgs.iproute}/bin/ip route add ${addr} via $addr dev $interface") + (addr: "${pkgs.iproute}/bin/ip route add ${addr} via $addr dev $interface || true") addrsViaDefaultInterface ); @@ -62,7 +62,7 @@ in addr=`${pkgs.iproute}/bin/ip route | ${pkgs.gawk}/bin/awk '/default/ {print $3; exit}'` interface=`${pkgs.iproute}/bin/ip route | ${pkgs.gawk}/bin/awk '/default/ {print $5; exit}'` '' + lib.concatLines (map - (addr: "${pkgs.iproute}/bin/ip route del ${addr} via $addr dev $interface") + (addr: "${pkgs.iproute}/bin/ip route del ${addr} via $addr dev $interface || true") addrsViaDefaultInterface );