2019-05-04 22:36:15 +01:00
|
|
|
{ stdenv, fetchurl, patchelfUnstable }:
|
2016-06-03 15:46:37 +01:00
|
|
|
|
2018-04-02 16:29:14 +01:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2019-03-12 17:19:10 +00:00
|
|
|
let versions = builtins.fromJSON (builtins.readFile ./versions.json);
|
|
|
|
arch = if stdenv.isi686 then "386"
|
|
|
|
else if stdenv.isx86_64 then "amd64"
|
|
|
|
else if stdenv.isAarch64 then "arm64"
|
|
|
|
else if stdenv.isArm then "arm"
|
|
|
|
else throw "Unsupported architecture";
|
|
|
|
os = if stdenv.isLinux then "linux"
|
|
|
|
else if stdenv.isDarwin then "darwin"
|
|
|
|
else throw "Unsupported os";
|
|
|
|
versionInfo = versions."${os}-${arch}";
|
|
|
|
inherit (versionInfo) version sha256 url;
|
|
|
|
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2016-06-03 15:46:37 +01:00
|
|
|
name = "ngrok-${version}";
|
2019-03-12 17:19:10 +00:00
|
|
|
version = "${version}";
|
|
|
|
|
|
|
|
# run ./update
|
|
|
|
src = fetchurl { inherit sha256 url; };
|
2016-06-03 15:46:37 +01:00
|
|
|
|
2017-08-27 22:08:18 +01:00
|
|
|
sourceRoot = ".";
|
2016-06-03 15:46:37 +01:00
|
|
|
|
2019-05-04 22:36:15 +01:00
|
|
|
nativeBuildInputs = [ patchelfUnstable ];
|
|
|
|
|
2019-03-12 17:19:10 +00:00
|
|
|
unpackPhase = "cp $src ngrok";
|
|
|
|
|
|
|
|
buildPhase = "chmod a+x ngrok";
|
2018-04-02 16:29:14 +01:00
|
|
|
|
2017-08-27 22:08:18 +01:00
|
|
|
installPhase = ''
|
|
|
|
install -D ngrok $out/bin/ngrok
|
2019-05-04 22:36:15 +01:00
|
|
|
|
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
$out/bin/ngrok
|
|
|
|
'';
|
2016-06-03 15:46:37 +01:00
|
|
|
|
2019-03-19 19:03:41 +00:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2018-04-02 16:29:14 +01:00
|
|
|
meta = {
|
2017-08-27 22:08:18 +01:00
|
|
|
description = "ngrok";
|
|
|
|
longDescription = ''
|
|
|
|
Allows you to expose a web server running on your local machine to the internet.
|
|
|
|
'';
|
|
|
|
homepage = https://ngrok.com/;
|
2018-04-02 16:29:14 +01:00
|
|
|
license = licenses.unfree;
|
2019-03-12 17:19:10 +00:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
|
2017-08-27 22:08:18 +01:00
|
|
|
maintainers = [ maintainers.bobvanderlinden ];
|
|
|
|
};
|
2016-06-03 15:46:37 +01:00
|
|
|
}
|