2022-04-27 09:35:20 +00:00
|
|
|
{ lib, stdenv, fetchzip }:
|
|
|
|
|
|
|
|
let
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "22.1.7";
|
2022-04-27 09:35:20 +00:00
|
|
|
platform = if stdenv.isLinux then "linux" else "darwin";
|
|
|
|
arch = if stdenv.isAarch64 then "arm" else "amd";
|
2022-05-18 14:49:53 +00:00
|
|
|
sha256s = {
|
2022-06-16 17:23:12 +00:00
|
|
|
darwin.amd = "sha256-AXk3aP1SGiHTfHTCBRTagX0DAVmdcVVIkxWaTnZxB8g=";
|
|
|
|
darwin.arm = "sha256-pvOVvNc8lZ2d2fVZVYWvumVWYpnLORNY/3o1t4BN2N4=";
|
2022-08-12 12:06:08 +00:00
|
|
|
linux.amd = "sha256-FjDDrJmLvelQ8PmTEtnvV+5zpixizR0bowoJPLyPFcA=";
|
2022-06-16 17:23:12 +00:00
|
|
|
linux.arm = "sha256-WHjYAbytiu747jFqN0KZ/CkIwAVI7fb32ywtRiQOBm8=";
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
2022-04-27 09:35:20 +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-18 14:49:53 +00:00
|
|
|
sha256 = sha256s.${platform}.${arch};
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp rpk $out/bin
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
${lib.optionalString stdenv.isLinux ''
|
|
|
|
patchelf \
|
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
$out/bin/rpk
|
|
|
|
''}
|
|
|
|
|
2022-04-27 09:35:20 +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-07-14 12:49:19 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2022-04-27 09:35:20 +00:00
|
|
|
license = licenses.bsl11;
|
|
|
|
homepage = "https://redpanda.com/";
|
|
|
|
maintainers = with maintainers; [ happysalada ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|