2021-01-15 10:19:50 +01:00
|
|
|
{ lib, stdenv, fetchurl }:
|
2016-06-03 16:46:37 +02:00
|
|
|
|
2021-01-15 10:19:50 +01:00
|
|
|
with lib;
|
2018-04-02 17:29:14 +02:00
|
|
|
|
2021-11-03 13:43:23 +01:00
|
|
|
let versions = lib.importJSON ./versions.json;
|
2019-03-12 18:19:10 +01:00
|
|
|
arch = if stdenv.isi686 then "386"
|
|
|
|
else if stdenv.isx86_64 then "amd64"
|
2020-01-03 05:36:01 +01:00
|
|
|
else if stdenv.isAarch32 then "arm"
|
2019-03-12 18:19:10 +01:00
|
|
|
else if stdenv.isAarch64 then "arm64"
|
|
|
|
else throw "Unsupported architecture";
|
|
|
|
os = if stdenv.isLinux then "linux"
|
2021-07-14 20:14:12 +02:00
|
|
|
else if stdenv.isDarwin then "darwin"
|
2019-03-12 18:19:10 +01:00
|
|
|
else throw "Unsupported os";
|
|
|
|
versionInfo = versions."${os}-${arch}";
|
|
|
|
inherit (versionInfo) version sha256 url;
|
|
|
|
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2021-11-29 19:24:13 +01:00
|
|
|
pname = "ngrok";
|
|
|
|
inherit version;
|
2019-03-12 18:19:10 +01:00
|
|
|
|
|
|
|
# run ./update
|
|
|
|
src = fetchurl { inherit sha256 url; };
|
2016-06-03 16:46:37 +02:00
|
|
|
|
2017-08-27 23:08:18 +02:00
|
|
|
sourceRoot = ".";
|
2016-06-03 16:46:37 +02:00
|
|
|
|
2019-03-12 18:19:10 +01:00
|
|
|
unpackPhase = "cp $src ngrok";
|
|
|
|
|
|
|
|
buildPhase = "chmod a+x ngrok";
|
2018-04-02 17:29:14 +02:00
|
|
|
|
2017-08-27 23:08:18 +02:00
|
|
|
installPhase = ''
|
|
|
|
install -D ngrok $out/bin/ngrok
|
2019-07-23 23:51:03 +02:00
|
|
|
'';
|
2016-06-03 16:46:37 +02:00
|
|
|
|
2019-03-19 20:03:41 +01:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2021-12-15 02:39:53 +01:00
|
|
|
# Stripping causes SEGFAULT on x86_64-darwin
|
|
|
|
dontStrip = true;
|
|
|
|
|
2018-04-02 17:29:14 +02:00
|
|
|
meta = {
|
2020-10-26 05:08:40 +01:00
|
|
|
description = "Allows you to expose a web server running on your local machine to the internet";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://ngrok.com/";
|
2018-04-02 17:29:14 +02:00
|
|
|
license = licenses.unfree;
|
2021-06-07 02:40:07 +02:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
2017-08-27 23:08:18 +02:00
|
|
|
maintainers = [ maintainers.bobvanderlinden ];
|
|
|
|
};
|
2016-06-03 16:46:37 +02:00
|
|
|
}
|