mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 06:14:57 +01:00
47 lines
1.3 KiB
Nix
47 lines
1.3 KiB
Nix
{ buildGoModule
|
|
, doCheck ? !stdenv.isDarwin # Can't start localhost test server in MacOS sandbox.
|
|
, fetchFromGitHub
|
|
, installShellFiles
|
|
, lib
|
|
, stdenv
|
|
}:
|
|
let
|
|
version = "24.2.4";
|
|
src = fetchFromGitHub {
|
|
owner = "redpanda-data";
|
|
repo = "redpanda";
|
|
rev = "v${version}";
|
|
sha256 = "sha256-DSwD9oN5hrDjUL0Ey8ARvojr54abBXUNvj/06lLvURk=";
|
|
};
|
|
in
|
|
buildGoModule rec {
|
|
pname = "redpanda-rpk";
|
|
inherit doCheck src version;
|
|
modRoot = "./src/go/rpk";
|
|
runVend = false;
|
|
vendorHash = "sha256-8vwmxUi4oWmHzb2QkIS5sU1NgJmJSV1+2I48TDAo2a0=";
|
|
|
|
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
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Redpanda client";
|
|
homepage = "https://redpanda.com/";
|
|
license = licenses.bsl11;
|
|
maintainers = with maintainers; [ avakhrenev happysalada ];
|
|
platforms = platforms.all;
|
|
mainProgram = "rpk";
|
|
};
|
|
}
|