1 { lib, stdenv, fetchurl }:
5 let versions = builtins.fromJSON (builtins.readFile ./versions.json);
6 arch = if stdenv.isi686 then "386"
7 else if stdenv.isx86_64 then "amd64"
8 else if stdenv.isAarch32 then "arm"
9 else if stdenv.isAarch64 then "arm64"
10 else throw "Unsupported architecture";
11 os = if stdenv.isLinux then "linux"
12 else if stdenv.isDarwin then "darwin"
13 else throw "Unsupported os";
14 versionInfo = versions."${os}-${arch}";
15 inherit (versionInfo) version sha256 url;
19 name = "ngrok-${version}";
23 src = fetchurl { inherit sha256 url; };
27 unpackPhase = "cp $src ngrok";
29 buildPhase = "chmod a+x ngrok";
32 install -D ngrok $out/bin/ngrok
35 passthru.updateScript = ./update.sh;
38 description = "Allows you to expose a web server running on your local machine to the internet";
39 homepage = "https://ngrok.com/";
40 license = licenses.unfree;
41 platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
42 maintainers = [ maintainers.bobvanderlinden ];