23b612e36f
GitOrigin-RevId: ae5c332cbb5827f6b1f02572496b141021de335f
53 lines
1.4 KiB
Nix
53 lines
1.4 KiB
Nix
{ buildGoModule
|
|
, callPackage
|
|
, doCheck ? !stdenv.isDarwin # Can't start localhost test server in MacOS sandbox.
|
|
, fetchFromGitHub
|
|
, installShellFiles
|
|
, lib
|
|
, stdenv
|
|
}:
|
|
let
|
|
version = "23.3.2";
|
|
src = fetchFromGitHub {
|
|
owner = "redpanda-data";
|
|
repo = "redpanda";
|
|
rev = "v${version}";
|
|
sha256 = "sha256-TRcTiwAK0epmQkV0pwAV1S1jXr0VCq9lZQkANjSToko=";
|
|
};
|
|
server = callPackage ./server.nix { inherit src version; };
|
|
in
|
|
buildGoModule rec {
|
|
pname = "redpanda-rpk";
|
|
inherit doCheck src version;
|
|
modRoot = "./src/go/rpk";
|
|
runVend = false;
|
|
vendorHash = "sha256-nXAjtRhiLmzgb6OVerX2liCinstsnxeBBpxSAQoLrjg=";
|
|
|
|
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
|
|
'';
|
|
|
|
passthru = {
|
|
inherit server;
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "Redpanda client";
|
|
homepage = "https://redpanda.com/";
|
|
license = licenses.bsl11;
|
|
maintainers = with maintainers; [ avakhrenev happysalada ];
|
|
platforms = platforms.all;
|
|
mainProgram = "rpk";
|
|
};
|
|
}
|