2023-02-22 10:55:15 +00:00
|
|
|
{ buildGoModule
|
|
|
|
, callPackage
|
|
|
|
, doCheck ? !stdenv.isDarwin # Can't start localhost test server in MacOS sandbox.
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, lib
|
|
|
|
, stdenv
|
|
|
|
}:
|
2022-04-27 09:35:20 +00:00
|
|
|
let
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "23.3.12";
|
2023-02-22 10:55:15 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "redpanda-data";
|
|
|
|
repo = "redpanda";
|
|
|
|
rev = "v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-gkJlqyPDsWaXcbOGB7m70YuHY44xLNymf9laK30yr1k=";
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
2023-02-22 10:55:15 +00:00
|
|
|
server = callPackage ./server.nix { inherit src version; };
|
|
|
|
in
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "redpanda-rpk";
|
|
|
|
inherit doCheck src version;
|
|
|
|
modRoot = "./src/go/rpk";
|
|
|
|
runVend = false;
|
2024-04-21 15:54:59 +00:00
|
|
|
vendorHash = "sha256-B//qmqxS3g9u2yir8Z3iV2fjQ4XXPAjFujeOZjdt8PE=";
|
2023-02-22 10:55:15 +00:00
|
|
|
|
|
|
|
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-04-27 09:35:20 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
passthru = {
|
|
|
|
inherit server;
|
|
|
|
};
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2023-02-22 10:55:15 +00:00
|
|
|
description = "Redpanda client";
|
2022-04-27 09:35:20 +00:00
|
|
|
homepage = "https://redpanda.com/";
|
2023-02-22 10:55:15 +00:00
|
|
|
license = licenses.bsl11;
|
|
|
|
maintainers = with maintainers; [ avakhrenev happysalada ];
|
2022-04-27 09:35:20 +00:00
|
|
|
platforms = platforms.all;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "rpk";
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
|
|
|
}
|