2023-04-12 12:48:02 +00:00
|
|
|
{ stdenv, lib, fetchzip, patchelf }:
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
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-B2dK4yZPBitt6WT0wBJB2Wvly3ykDlFVZT5409XH7GY=";
|
|
|
|
aarch64-linux = "sha256-FQ+RvOmB4j3Y67tIx0OqkjFunkhYMNJASZUkTOMxKTU=";
|
|
|
|
armv7l-linux = "sha256-bRhaF3PaulcjzVxB3kalvHrJKK8sEOnmXJnjBI7yBbk=";
|
|
|
|
}.${system} or throwSystem;
|
|
|
|
in
|
2023-04-12 12:48:02 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "zrok";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "0.4.0";
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
src = fetchzip {
|
2023-07-15 17:15:38 +00:00
|
|
|
url = "https://github.com/openziti/zrok/releases/download/v${version}/zrok_${version}_${plat}.tar.gz";
|
2023-04-12 12:48:02 +00:00
|
|
|
stripRoot = false;
|
2023-07-15 17:15:38 +00:00
|
|
|
inherit sha256;
|
2023-04-12 12:48:02 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
updateScript = ./update.sh;
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
installPhase = let
|
|
|
|
interpreter = "$(< \"$NIX_CC/nix-support/dynamic-linker\")";
|
|
|
|
in ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp zrok $out/bin/
|
|
|
|
chmod +x $out/bin/zrok
|
|
|
|
patchelf --set-interpreter "${interpreter}" "$out/bin/zrok"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Geo-scale, next-generation sharing platform built on top of OpenZiti";
|
|
|
|
homepage = "https://zrok.io";
|
|
|
|
maintainers = [ lib.maintainers.bandresen ];
|
2023-07-15 17:15:38 +00:00
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" "armv7l-linux" ];
|
2023-04-12 12:48:02 +00:00
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
2023-07-15 17:15:38 +00:00
|
|
|
license = lib.licenses.asl20;
|
2023-04-12 12:48:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|