2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
let versions = lib.importJSON ./versions.json;
|
2020-04-24 23:36:52 +00:00
|
|
|
arch = if stdenv.isi686 then "386"
|
|
|
|
else if stdenv.isx86_64 then "amd64"
|
|
|
|
else if stdenv.isAarch32 then "arm"
|
|
|
|
else if stdenv.isAarch64 then "arm64"
|
|
|
|
else throw "Unsupported architecture";
|
|
|
|
os = if stdenv.isLinux then "linux"
|
2021-07-14 22:03:04 +00:00
|
|
|
else if stdenv.isDarwin then "darwin"
|
2020-04-24 23:36:52 +00:00
|
|
|
else throw "Unsupported os";
|
|
|
|
versionInfo = versions."${os}-${arch}";
|
|
|
|
inherit (versionInfo) version sha256 url;
|
|
|
|
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "ngrok";
|
|
|
|
inherit version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# run ./update
|
|
|
|
src = fetchurl { inherit sha256 url; };
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
unpackPhase = "cp $src ngrok";
|
|
|
|
|
|
|
|
buildPhase = "chmod a+x ngrok";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -D ngrok $out/bin/ngrok
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2021-12-21 02:18:32 +00:00
|
|
|
# Stripping causes SEGFAULT on x86_64-darwin
|
|
|
|
dontStrip = true;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
meta = with lib; {
|
2020-11-03 02:18:15 +00:00
|
|
|
description = "Allows you to expose a web server running on your local machine to the internet";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://ngrok.com/";
|
2023-02-02 18:25:31 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.unfree;
|
2021-06-28 23:13:55 +00:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
2022-06-16 17:23:12 +00:00
|
|
|
maintainers = with maintainers; [ bobvanderlinden brodes ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|