about summary refs log tree commit diff
path: root/pkgs/tools/networking/zrok/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/networking/zrok/default.nix')
-rw-r--r--pkgs/tools/networking/zrok/default.nix24
1 files changed, 21 insertions, 3 deletions
diff --git a/pkgs/tools/networking/zrok/default.nix b/pkgs/tools/networking/zrok/default.nix
index a0d09cb488e1f..96c4bd89f96d9 100644
--- a/pkgs/tools/networking/zrok/default.nix
+++ b/pkgs/tools/networking/zrok/default.nix
@@ -1,15 +1,33 @@
 { stdenv, lib, fetchzip, patchelf }:
 
+let
+  inherit (stdenv.hostPlatform) system;
+  throwSystem = throw "Unsupported system: ${system}";
+
+  plat = {
+    x86_64-linux = "linux_amd64";
+    aarch64-linux = "linux_arm64";
+    armv7l-linux = "linux_armv7";
+  }.${system} or throwSystem;
+
+  sha256 = {
+    x86_64-linux = "sha256-gcmgpvfk7bciTmotTHObvZvLPdLudAR2vQneLKN+uE4=";
+    aarch64-linux = "sha256-cZDekIW2Z7hfIY6Y4xhsmgvMLnKYo6H9BAMg9/I5a10=";
+    armv7l-linux = "sha256-Fn2e1ywuTUt58geT4hNb3YEZiJDE6TUKaKI/xpsG69c=";
+  }.${system} or throwSystem;
+in
 stdenv.mkDerivation rec {
   pname = "zrok";
   version = "0.3.6";
 
   src = fetchzip {
-    url = "https://github.com/openziti/zrok/releases/download/v${version}/zrok_${version}_linux_amd64.tar.gz";
+    url = "https://github.com/openziti/zrok/releases/download/v${version}/zrok_${version}_${plat}.tar.gz";
     stripRoot = false;
-    sha256 = "sha256-gcmgpvfk7bciTmotTHObvZvLPdLudAR2vQneLKN+uE4=";
+    inherit sha256;
   };
 
+  updateScript = ./update.sh;
+
   installPhase = let
     interpreter = "$(< \"$NIX_CC/nix-support/dynamic-linker\")";
   in ''
@@ -23,7 +41,7 @@ stdenv.mkDerivation rec {
     description = "Geo-scale, next-generation sharing platform built on top of OpenZiti";
     homepage = "https://zrok.io";
     maintainers = [ lib.maintainers.bandresen ];
-    platforms = [ "x86_64-linux" ];
+    platforms = [ "x86_64-linux" "aarch64-linux" "armv7l-linux" ];
     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
     license = lib.licenses.apsl20;
   };