lint-staged: 15.2.10 -> 15.2.11 (#364089)
[NixPkgs.git] / pkgs / tools / networking / namespaced-openvpn / default.nix
blobec48d87230492da5efd1f66f4101404f9b36924d
2   lib,
3   fetchFromGitHub,
4   buildPythonPackage,
5   openvpn,
6   iproute2,
7   iptables,
8   util-linux,
9 }:
11 buildPythonPackage rec {
12   pname = "namespaced-openvpn";
13   version = "0.6.0";
14   format = "other";
16   src = fetchFromGitHub {
17     owner = "slingamn";
18     repo = pname;
19     rev = "a3fa42b2d8645272cbeb6856e26a7ea9547cb7d1";
20     sha256 = "+Fdaw9EGyFGH9/DSeVJczS8gPzAOv+qn+1U20zQBBqQ=";
21   };
23   buildInputs = [
24     openvpn
25     iproute2
26     util-linux
27   ];
29   postPatch = ''
30     substituteInPlace namespaced-openvpn \
31       --replace-fail "/usr/sbin/openvpn" "${openvpn}/bin/openvpn" \
32       --replace-fail "/sbin/ip" "${iproute2}/bin/ip" \
33       --replace-fail "/usr/bin/nsenter" "${util-linux}/bin/nsenter" \
34       --replace-fail "/bin/mount" "${util-linux}/bin/mount" \
35       --replace-fail "/bin/umount" "${util-linux}/bin/umount"
37     substituteInPlace seal-unseal-gateway \
38       --replace-fail "/sbin/iptables" "${iptables}/bin/iptables"
39   '';
41   dontBuild = true;
42   doCheck = false;
44   installPhase = ''
45     mkdir -p $out/bin
46     cp namespaced-openvpn seal-unseal-gateway $out/bin
47   '';
49   meta = with lib; {
50     homepage = "https://github.com/slingamn/namespaced-openvpn";
51     description = "Network namespace isolation for OpenVPN tunnels";
52     license = licenses.mit;
53     maintainers = [ maintainers.lodi ];
54     platforms = platforms.linux;
55     mainProgram = "namespaced-openvpn";
56   };