2015-09-24 01:32:25 +02:00
|
|
|
{ stdenv, fetchFromGitHub, fetchpatch, makeWrapper, pandoc
|
2015-09-24 09:44:10 +02:00
|
|
|
, coreutils, iptables, nettools, openssh, procps, pythonPackages }:
|
2013-10-05 16:45:51 +02:00
|
|
|
|
2015-09-23 12:19:24 +02:00
|
|
|
let version = "0.71"; in
|
2013-10-05 16:45:51 +02:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "sshuttle-${version}";
|
|
|
|
|
2015-09-23 12:19:24 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
sha256 = "0yr8nih97jg6azfj3k7064lfbh3g36l6vwyjlngl4ph6mgcki1cm";
|
|
|
|
rev = name;
|
|
|
|
repo = "sshuttle";
|
|
|
|
owner = "sshuttle";
|
2013-10-05 16:45:51 +02:00
|
|
|
};
|
|
|
|
|
2015-09-24 01:32:25 +02:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
sha256 = "1yrjyvdz6k6zk020dmbagf8w49w8vhfbzgfpsq9jqdh2hbykv3m3";
|
|
|
|
url = https://github.com/sshuttle/sshuttle/commit/3cf5002b62650c26a50e18af8d8c5c91d754bab9.patch;
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
sha256 = "091gg28cnmx200q46bcnxpp9ih9p5qlq0r3bxfm0f4qalg8rmp2g";
|
|
|
|
url = https://github.com/sshuttle/sshuttle/commit/d70b5f2b89e593506834cf8ea10785d96c801dfc.patch;
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
sha256 = "17l9h8clqlbyxdkssavxqpb902j7b3yabrrdalybfpkhj69x8ghk";
|
|
|
|
url = https://github.com/sshuttle/sshuttle/commit/a38963301e9c29fbe3232f0a41ea080b642c5ad2.patch;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2015-09-23 12:19:24 +02:00
|
|
|
nativeBuildInputs = [ makeWrapper pandoc ];
|
2015-09-24 09:44:10 +02:00
|
|
|
buildInputs =
|
|
|
|
[ coreutils iptables nettools openssh procps pythonPackages.python ];
|
|
|
|
pythonPaths = with pythonPackages; [ PyXAPI ];
|
2013-10-05 16:45:51 +02:00
|
|
|
|
2015-09-23 12:19:24 +02:00
|
|
|
preConfigure = ''
|
|
|
|
cd src
|
|
|
|
'';
|
2013-10-05 16:45:51 +02:00
|
|
|
|
2015-09-24 09:44:10 +02:00
|
|
|
installPhase = let
|
|
|
|
mapPath = f: x: stdenv.lib.concatStringsSep ":" (map f x);
|
|
|
|
in ''
|
2015-09-23 12:19:24 +02:00
|
|
|
mkdir -p $out/share/sshuttle
|
|
|
|
cp -R sshuttle *.py compat $out/share/sshuttle
|
|
|
|
|
2013-10-05 16:45:51 +02:00
|
|
|
mkdir -p $out/bin
|
2015-09-23 12:19:24 +02:00
|
|
|
ln -s $out/share/sshuttle/sshuttle $out/bin
|
2015-09-24 09:44:10 +02:00
|
|
|
wrapProgram $out/bin/sshuttle \
|
|
|
|
--prefix PATH : "${mapPath (x: "${x}/bin") buildInputs}" \
|
|
|
|
--prefix PYTHONPATH : "${mapPath (x: "$(toPythonPath ${x})") pythonPaths}"
|
2015-09-23 12:19:24 +02:00
|
|
|
|
|
|
|
install -Dm644 sshuttle.8 $out/share/man/man8/sshuttle.8
|
2013-10-05 16:45:51 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2015-09-23 12:19:24 +02:00
|
|
|
inherit version;
|
|
|
|
inherit (src.meta) homepage;
|
2013-10-05 16:45:51 +02:00
|
|
|
description = "Transparent proxy server that works as a poor man's VPN";
|
2015-09-23 12:19:24 +02:00
|
|
|
longDescription = ''
|
|
|
|
Forward connections over SSH, without requiring administrator access to the
|
|
|
|
target network (though it does require Python 2 at both ends).
|
|
|
|
Works with Linux and Mac OS and supports DNS tunneling.
|
|
|
|
'';
|
|
|
|
maintainers = with maintainers; [ iElectric nckx ];
|
2013-10-05 16:45:51 +02:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|