about summary refs log tree commit diff
path: root/pkgs/by-name/ng/ngrok/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/ng/ngrok/package.nix')
-rw-r--r--pkgs/by-name/ng/ngrok/package.nix24
1 files changed, 14 insertions, 10 deletions
diff --git a/pkgs/by-name/ng/ngrok/package.nix b/pkgs/by-name/ng/ngrok/package.nix
index daf9da5c8f2f..a2f5fc51df92 100644
--- a/pkgs/by-name/ng/ngrok/package.nix
+++ b/pkgs/by-name/ng/ngrok/package.nix
@@ -2,25 +2,26 @@
   lib,
   stdenv,
   fetchurl,
+  testers,
 }:
 
 let
   versions = lib.importJSON ./versions.json;
   arch =
-    if stdenv.isi686 then
+    if stdenv.hostPlatform.isi686 then
       "386"
-    else if stdenv.isx86_64 then
+    else if stdenv.hostPlatform.isx86_64 then
       "amd64"
-    else if stdenv.isAarch32 then
+    else if stdenv.hostPlatform.isAarch32 then
       "arm"
-    else if stdenv.isAarch64 then
+    else if stdenv.hostPlatform.isAarch64 then
       "arm64"
     else
       throw "Unsupported architecture";
   os =
-    if stdenv.isLinux then
+    if stdenv.hostPlatform.isLinux then
       "linux"
-    else if stdenv.isDarwin then
+    else if stdenv.hostPlatform.isDarwin then
       "darwin"
     else
       throw "Unsupported os";
@@ -28,7 +29,7 @@ let
   inherit (versionInfo) version sha256 url;
 
 in
-stdenv.mkDerivation {
+stdenv.mkDerivation (finalAttrs: {
   pname = "ngrok";
   inherit version;
 
@@ -55,10 +56,13 @@ stdenv.mkDerivation {
     runHook postInstall
   '';
 
-  passthru.updateScript = ./update.sh;
+  passthru = {
+    updateScript = ./update.sh;
+    tests.version = testers.testVersion { package = finalAttrs.finalPackage; };
+  };
 
   # Stripping causes SEGFAULT on darwin
-  dontStrip = stdenv.isDarwin;
+  dontStrip = stdenv.hostPlatform.isDarwin;
 
   meta = {
     description = "Allows you to expose a web server running on your local machine to the internet";
@@ -74,4 +78,4 @@ stdenv.mkDerivation {
     ];
     mainProgram = "ngrok";
   };
-}
+})