From 5b831082575b1539bcf05d2e688634fe20334201 Mon Sep 17 00:00:00 2001 From: Florian Warzecha Date: Tue, 17 Oct 2023 19:09:57 +0200 Subject: [PATCH] vpn-slice: replace propagatedInputs with substituteInPlace Does not rely on python builder specific magic to provide the runtime binaries this way. --- pkgs/tools/networking/vpn-slice/default.nix | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pkgs/tools/networking/vpn-slice/default.nix b/pkgs/tools/networking/vpn-slice/default.nix index 3fcc0787b184..3fb921bb44b8 100644 --- a/pkgs/tools/networking/vpn-slice/default.nix +++ b/pkgs/tools/networking/vpn-slice/default.nix @@ -20,13 +20,16 @@ buildPythonApplication rec { sha256 = "sha256-T6VULLNRLWO4OcAsuTmhty6H4EhinyxQSg0dfv2DUJs="; }; - propagatedBuildInputs = with python3Packages; [ setproctitle dnspython ] - ++ lib.optionals stdenv.isLinux [ - iproute2 - iptables - ] ++ lib.optionals stdenv.isDarwin [ - unixtools.route - ]; + postPatch = lib.optionalString stdenv.isDarwin '' + substituteInPlace vpn_slice/mac.py \ + --replace "'/sbin/route'" "'${unixtools.route}/bin/route'" + '' + lib.optionalString stdenv.isLinux '' + substituteInPlace vpn_slice/linux.py \ + --replace "'/sbin/ip'" "'${iproute2}/bin/ip'" \ + --replace "'/sbin/iptables'" "'${iptables}/bin/iptables'" + ''; + + propagatedBuildInputs = with python3Packages; [ setproctitle dnspython ]; doCheck = false;