2022-05-02 23:49:02 +00:00
|
|
|
{ lib, stdenv, fetchzip }:
|
|
|
|
|
|
|
|
let
|
2023-01-31 01:50:00 +00:00
|
|
|
version = "22.3.11";
|
2022-05-02 23:49:02 +00:00
|
|
|
platform = if stdenv.isLinux then "linux" else "darwin";
|
|
|
|
arch = if stdenv.isAarch64 then "arm" else "amd";
|
2022-05-14 06:28:59 +00:00
|
|
|
sha256s = {
|
2023-01-31 01:50:00 +00:00
|
|
|
darwin.amd = "sha256-kwAKxFg7BSNInvsQvFqgtpq8EEwSnmDeDyaF5b8L8SQ=";
|
|
|
|
darwin.arm = "sha256-kH5Ii672SeAIiRcWuAO3oVJVSBWp+r78RmTiR3BaDbg=";
|
|
|
|
linux.amd = "sha256-EKgkRKBrM4+X2YGoP2LpWRHL+fdHu44LYwCZ+O+c5ZY=";
|
|
|
|
linux.arm = "sha256-9b4oerRXjUVUYoswJWtnMBJSQDoCKClf673VjDQFUAw=";
|
2022-05-14 06:28:59 +00:00
|
|
|
};
|
2022-05-02 23:49:02 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "redpanda";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/redpanda-data/redpanda/releases/download/v${version}/rpk-${platform}-${arch}64.zip";
|
2022-05-14 06:28:59 +00:00
|
|
|
sha256 = sha256s.${platform}.${arch};
|
2022-05-02 23:49:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp rpk $out/bin
|
|
|
|
|
2022-05-26 13:13:38 +00:00
|
|
|
${lib.optionalString stdenv.isLinux ''
|
|
|
|
patchelf \
|
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
$out/bin/rpk
|
|
|
|
''}
|
|
|
|
|
2022-05-02 23:49:02 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
# stripping somehow completely breaks it
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Redpanda is a streaming data platform for developers. Kafka API compatible. 10x faster. No ZooKeeper. No JVM! ";
|
2022-06-16 23:40:08 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2022-05-02 23:49:02 +00:00
|
|
|
license = licenses.bsl11;
|
|
|
|
homepage = "https://redpanda.com/";
|
|
|
|
maintainers = with maintainers; [ happysalada ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|