2023-02-17 07:13:05 +01:00
|
|
|
{ buildGoModule
|
|
|
|
, callPackage
|
|
|
|
, doCheck ? !stdenv.isDarwin # Can't start localhost test server in MacOS sandbox.
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, lib
|
|
|
|
, stdenv
|
|
|
|
}:
|
2022-05-03 01:49:02 +02:00
|
|
|
let
|
2023-02-17 07:13:05 +01:00
|
|
|
version = "22.3.13";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "redpanda-data";
|
|
|
|
repo = "redpanda";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-cUQFDXWnQYSLcfKFYg6BLrxF77iX+Yx3hcul4tMxdoc=";
|
2022-05-03 01:49:02 +02:00
|
|
|
};
|
2023-02-17 07:13:05 +01:00
|
|
|
server = callPackage ./server.nix { inherit src version; };
|
|
|
|
in
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "redpanda-rpk";
|
|
|
|
inherit doCheck src version;
|
|
|
|
modRoot = "./src/go/rpk";
|
|
|
|
runVend = false;
|
|
|
|
vendorSha256 = "sha256-JVZuHRh3gavIGArxDkqUQsL5oBjz35EKGsC75Sy+cMo=";
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
''-X "github.com/redpanda-data/redpanda/src/go/rpk/pkg/cli/cmd/version.version=${version}"''
|
|
|
|
''-X "github.com/redpanda-data/redpanda/src/go/rpk/pkg/cli/cmd/version.rev=v${version}"''
|
|
|
|
''-X "github.com/redpanda-data/redpanda/src/go/rpk/pkg/cli/cmd/container/common.tag=v${version}"''
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
for shell in bash fish zsh; do
|
|
|
|
$out/bin/rpk generate shell-completion $shell > rpk.$shell
|
|
|
|
installShellCompletion rpk.$shell
|
|
|
|
done
|
2022-05-03 01:49:02 +02:00
|
|
|
'';
|
|
|
|
|
2023-02-17 07:13:05 +01:00
|
|
|
passthru = {
|
|
|
|
inherit server;
|
|
|
|
};
|
2022-05-03 01:49:02 +02:00
|
|
|
|
|
|
|
meta = with lib; {
|
2023-02-17 07:13:05 +01:00
|
|
|
description = "Redpanda client";
|
2022-05-03 01:49:02 +02:00
|
|
|
homepage = "https://redpanda.com/";
|
2023-02-17 07:13:05 +01:00
|
|
|
license = licenses.bsl11;
|
|
|
|
maintainers = with maintainers; [ avakhrenev happysalada ];
|
2022-05-03 01:49:02 +02:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|