Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, stdenv
3, python3Packages
4, fetchPypi
5, makeWrapper
6, coreutils
7, iptables
8, nettools
9, openssh
10, procps
11}:
12
13python3Packages.buildPythonApplication rec {
14 pname = "sshuttle";
15 version = "1.1.1";
16
17 src = fetchPypi {
18 inherit pname version;
19 sha256 = "sha256-9aPtHlqxITx6bfhgr0HxqQOrLK+/73Hzcazc/yHmnuY=";
20 };
21
22 patches = [ ./sudo.patch ];
23
24 postPatch = ''
25 substituteInPlace setup.cfg \
26 --replace '--cov=sshuttle --cov-branch --cov-report=term-missing' ""
27 '';
28
29 nativeBuildInputs = [ makeWrapper python3Packages.setuptools-scm ];
30
31 nativeCheckInputs = with python3Packages; [ pytestCheckHook ];
32
33 postInstall = ''
34 wrapProgram $out/bin/sshuttle \
35 --prefix PATH : "${lib.makeBinPath ([ coreutils openssh procps ] ++ lib.optionals stdenv.isLinux [ iptables nettools ])}" \
36 '';
37
38 meta = with lib; {
39 homepage = "https://github.com/sshuttle/sshuttle/";
40 description = "Transparent proxy server that works as a poor man's VPN";
41 longDescription = ''
42 Forward connections over SSH, without requiring administrator access to the
43 target network (though it does require Python 2.7, Python 3.5 or later at both ends).
44 Works with Linux and Mac OS and supports DNS tunneling.
45 '';
46 license = licenses.lgpl21;
47 maintainers = with maintainers; [ domenkozar carlosdagos SuperSandro2000 ];
48 };
49}