2023-10-19 13:55:26 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonApplication
|
|
|
|
, nix-update-script
|
|
|
|
, python3Packages
|
|
|
|
, fetchFromGitHub
|
|
|
|
, iproute2
|
|
|
|
, iptables
|
|
|
|
, unixtools
|
|
|
|
}:
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "vpn-slice";
|
2021-12-30 13:39:12 +00:00
|
|
|
version = "0.16.1";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dlenski";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-12-30 13:39:12 +00:00
|
|
|
sha256 = "sha256-T6VULLNRLWO4OcAsuTmhty6H4EhinyxQSg0dfv2DUJs=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
2023-10-19 13:55:26 +00:00
|
|
|
substituteInPlace vpn_slice/mac.py \
|
|
|
|
--replace "'/sbin/route'" "'${unixtools.route}/bin/route'"
|
2024-09-26 11:04:55 +00:00
|
|
|
'' + lib.optionalString stdenv.hostPlatform.isLinux ''
|
2023-10-19 13:55:26 +00:00
|
|
|
substituteInPlace vpn_slice/linux.py \
|
|
|
|
--replace "'/sbin/ip'" "'${iproute2}/bin/ip'" \
|
|
|
|
--replace "'/sbin/iptables'" "'${iptables}/bin/iptables'"
|
|
|
|
'';
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
propagatedBuildInputs = with python3Packages; [ setproctitle dnspython ];
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
passthru = {
|
2022-12-28 21:21:41 +00:00
|
|
|
updateScript = nix-update-script { };
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/dlenski/vpn-slice";
|
|
|
|
description =
|
|
|
|
"vpnc-script replacement for easy and secure split-tunnel VPN setup";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "vpn-slice";
|
2020-09-25 04:45:31 +00:00
|
|
|
license = licenses.gpl3;
|
2024-07-27 06:49:29 +00:00
|
|
|
maintainers = [ ];
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
}
|