nixpkgs/pkgs/tools/networking/zrok/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

57 lines
1.5 KiB
Nix
Raw Normal View History

2023-12-11 21:34:35 +00:00
{ lib
, stdenv
, fetchzip
}:
2023-03-18 15:35:53 +00:00
2023-06-08 05:32:51 +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;
2023-12-11 21:34:35 +00:00
hash = {
2024-03-10 18:38:19 +00:00
x86_64-linux = "sha256-XzMd2NgMY8AUSjdYDyOEcK3HlZ5hl+L/ulHgy2iDtKg=";
aarch64-linux = "sha256-ypjg73ciUhXIyiNSLzim8AZV0ByU27WRc3PJqTyTllg=";
armv7l-linux = "sha256-VgVn5NsGpvGpkLQRZDphOgeZFQzhR2rVfcwi/EkJ/y4=";
2023-06-08 05:32:51 +00:00
}.${system} or throwSystem;
in
2023-12-11 21:34:35 +00:00
stdenv.mkDerivation (finalAttrs: {
2023-03-18 15:35:53 +00:00
pname = "zrok";
2024-03-10 18:38:19 +00:00
version = "0.4.26";
2023-03-18 15:35:53 +00:00
src = fetchzip {
2023-12-11 21:34:35 +00:00
url = "https://github.com/openziti/zrok/releases/download/v${finalAttrs.version}/zrok_${finalAttrs.version}_${plat}.tar.gz";
2023-03-18 15:35:53 +00:00
stripRoot = false;
2023-12-11 21:34:35 +00:00
inherit hash;
2023-03-18 15:35:53 +00:00
};
2023-06-08 05:32:51 +00:00
updateScript = ./update.sh;
2023-03-18 15:35:53 +00:00
installPhase = let
interpreter = "$(< \"$NIX_CC/nix-support/dynamic-linker\")";
in ''
2023-12-11 21:34:35 +00:00
runHook preInstall
2023-03-18 15:35:53 +00:00
mkdir -p $out/bin
cp zrok $out/bin/
chmod +x $out/bin/zrok
patchelf --set-interpreter "${interpreter}" "$out/bin/zrok"
2023-12-11 21:34:35 +00:00
runHook postInstall
2023-03-18 15:35:53 +00:00
'';
meta = {
description = "Geo-scale, next-generation sharing platform built on top of OpenZiti";
homepage = "https://zrok.io";
2023-12-11 21:34:35 +00:00
license = lib.licenses.asl20;
mainProgram = "zrok";
2023-03-18 15:35:53 +00:00
maintainers = [ lib.maintainers.bandresen ];
2023-06-08 05:32:51 +00:00
platforms = [ "x86_64-linux" "aarch64-linux" "armv7l-linux" ];
2023-03-18 15:35:53 +00:00
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
2023-12-11 21:34:35 +00:00
})