diff --git a/nix/configuration/roles/network/default.nix b/nix/configuration/roles/network/default.nix index 27845a47..62f3ed82 100644 --- a/nix/configuration/roles/network/default.nix +++ b/nix/configuration/roles/network/default.nix @@ -15,6 +15,14 @@ # "2001:4860:4860::8844#dns.google" # "2001:4860:4860::8888#dns.google" +let + patchScriptBin = + filename: contents: + ((pkgs.writeScriptBin filename contents).overrideAttrs (old: { + buildCommand = "${old.buildCommand}\n patchShebangs $out"; + })); + next_hop = (patchScriptBin "next_hop" (builtins.readFile ./files/next_hop_linux.bash)); +in { imports = [ ]; @@ -88,6 +96,7 @@ arp-scan # To find devices on the network wavemon dhcpcd # For Android USB tethering. + next_hop ]; boot.extraModprobeConfig = '' diff --git a/nix/configuration/roles/network/files/next_hop_linux.bash b/nix/configuration/roles/network/files/next_hop_linux.bash new file mode 100644 index 00000000..4b72c84e --- /dev/null +++ b/nix/configuration/roles/network/files/next_hop_linux.bash @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# +set -euo pipefail +IFS=$'\n\t' +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +exec ip route get "${@}"