diff options
Diffstat (limited to 'nixpkgs/pkgs/servers/redpanda/default.nix')
-rw-r--r-- | nixpkgs/pkgs/servers/redpanda/default.nix | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/redpanda/default.nix b/nixpkgs/pkgs/servers/redpanda/default.nix new file mode 100644 index 000000000000..603b8332776a --- /dev/null +++ b/nixpkgs/pkgs/servers/redpanda/default.nix @@ -0,0 +1,53 @@ +{ buildGoModule +, callPackage +, doCheck ? !stdenv.isDarwin # Can't start localhost test server in MacOS sandbox. +, fetchFromGitHub +, installShellFiles +, lib +, stdenv +}: +let + version = "23.3.10"; + src = fetchFromGitHub { + owner = "redpanda-data"; + repo = "redpanda"; + rev = "v${version}"; + sha256 = "sha256-PW1L+JwKnfeGFqXo+PTuzJS2FfkcoCU+xFjIt6zhn/M="; + }; + 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-sN21Y1e08gG8z/RfYIPGEeWW58YH66uB+16b2Bzb/3I="; + + 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"; + }; +} |