nixpkgs/pkgs/tools/networking/telepresence/default.nix

66 lines
1.9 KiB
Nix
Raw Normal View History

2017-09-13 16:37:46 +02:00
{ lib, stdenv, fetchgit, fetchFromGitHub, makeWrapper, git
2018-07-06 19:23:43 +02:00
, python3, sshfs-fuse, torsocks, sshuttle, conntrack-tools
, openssh, which, coreutils, iptables, bash }:
2017-09-13 16:37:46 +02:00
let
sshuttle-telepresence = lib.overrideDerivation sshuttle (p: {
src = fetchgit {
url = "https://github.com/datawire/sshuttle.git";
2018-07-06 19:23:43 +02:00
rev = "32226ff14d98d58ccad2a699e10cdfa5d86d6269";
sha256 = "1q20lnljndwcpgqv2qrf1k0lbvxppxf98a4g5r9zd566znhcdhx3";
2017-09-13 16:37:46 +02:00
leaveDotGit = true;
};
buildInputs = p.buildInputs ++ [ git ];
postPatch = "rm sshuttle/tests/client/test_methods_nat.py";
postInstall = "mv $out/bin/sshuttle $out/bin/sshuttle-telepresence";
});
in stdenv.mkDerivation rec {
pname = "telepresence";
2018-07-06 19:23:43 +02:00
version = "0.85";
2017-09-13 16:37:46 +02:00
name = "${pname}-${version}";
src = fetchFromGitHub {
owner = "datawire";
repo = "telepresence";
rev = version;
2018-07-06 19:23:43 +02:00
sha256 = "1iypqrx9pnhaz3p5bvl6g0c0c3d1799dv0xdjrzc1z5wa8diawvj";
2017-09-13 16:37:46 +02:00
};
2018-07-06 19:23:43 +02:00
buildInputs = [ makeWrapper python3 ];
2017-09-13 16:37:46 +02:00
phases = ["unpackPhase" "installPhase"];
installPhase = ''
mkdir -p $out/libexec $out/bin
2018-07-06 19:23:43 +02:00
export PREFIX=$out
substituteInPlace ./install.sh \
--replace "#!/bin/bash" "#!${stdenv.shell}" \
--replace '"''${VENVDIR}/bin/pip" -q install "git+https://github.com/datawire/sshuttle.git@telepresence"' "" \
--replace '"''${VENVDIR}/bin/sshuttle-telepresence"' '"${sshuttle-telepresence}/bin/sshuttle-telepresence"'
./install.sh
wrapProgram $out/bin/telepresence \
--prefix PATH : ${lib.makeBinPath [
python3
sshfs-fuse
torsocks
conntrack-tools
sshuttle-telepresence
openssh
which
coreutils
iptables
bash
]}
2017-09-13 16:37:46 +02:00
'';
meta = {
homepage = https://www.telepresence.io/;
description = "Local development against a remote Kubernetes or OpenShift cluster";
license = with lib.licenses; [ asl20 ];
maintainers = with lib.maintainers; [ offline ];
};
}