about summary refs log tree commit diff
path: root/pkgs/tools/misc/ngrok/default.nix
blob: fe2aa236cd573107c26a38c26ccebfd6401fcfb3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ stdenv, fetchurl, go, git, mercurial, bazaar, cacert }:

stdenv.mkDerivation rec {
  name = "ngrok-${version}";
  version = "1.6";

  src = fetchurl {
    url = "https://github.com/inconshreveable/ngrok/archive/${version}.tar.gz";
    sha256 = "0w54ck00ma8wd87gc3dligypdjs7vrzbi9py46sqphsid3rihkjr";
  };

  buildInputs = [ go git mercurial bazaar ];

  GIT_SSL_CAINFO = "${cacert}/etc/ca-bundle.crt";

  preBuild = ''
    export HOME="$PWD"
  '';

  installPhase = ''
    make release-client
    mkdir -p $out/bin
    cp bin/ngrok $out/bin
    cp -R assets $out/
  '';

  meta = with stdenv.lib; {
    description = "Reverse proxy that creates a secure tunnel between from a public endpoint to a locally running web service";
    homepage = https://ngrok.com/;
    license = licenses.asl20;
    maintainers = with maintainers; [ iElectric ];
    platforms = stdenv.lib.platforms.linux;
  };
}