1{
2 lib,
3 stdenv,
4 python3Packages,
5 fetchFromGitHub,
6 installShellFiles,
7 makeWrapper,
8 sphinx,
9 coreutils,
10 iptables,
11 net-tools,
12 openssh,
13 procps,
14}:
15
16python3Packages.buildPythonApplication rec {
17 pname = "sshuttle";
18 version = "1.3.1";
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "sshuttle";
23 repo = "sshuttle";
24 tag = "v${version}";
25 hash = "sha256-/ThWsPtFuUo41+Xw23UigZup1fq6/SAzDpxIaT0Vhvg=";
26 };
27
28 build-system = [ python3Packages.hatchling ];
29
30 nativeBuildInputs = [
31 installShellFiles
32 makeWrapper
33 sphinx
34 ];
35
36 nativeCheckInputs = with python3Packages; [
37 pytest-cov-stub
38 pytestCheckHook
39 ];
40
41 postBuild = ''
42 make man -C docs
43 '';
44
45 postInstall = ''
46 installManPage docs/_build/man/*
47
48 wrapProgram $out/bin/sshuttle \
49 --prefix PATH : "${
50 lib.makeBinPath (
51 [
52 coreutils
53 openssh
54 procps
55 ]
56 ++ lib.optionals stdenv.hostPlatform.isLinux [
57 iptables
58 net-tools
59 ]
60 )
61 }" \
62 '';
63
64 meta = {
65 description = "Transparent proxy server that works as a poor man's VPN";
66 mainProgram = "sshuttle";
67 longDescription = ''
68 Forward connections over SSH, without requiring administrator access to the
69 target network (though it does require Python 2.7, Python 3.5 or later at both ends).
70 Works with Linux and Mac OS and supports DNS tunneling.
71 '';
72 homepage = "https://github.com/sshuttle/sshuttle";
73 changelog = "https://github.com/sshuttle/sshuttle/blob/${src.tag}/CHANGES.rst";
74 license = lib.licenses.lgpl21Plus;
75 maintainers = with lib.maintainers; [
76 carlosdagos
77 ];
78 };
79}