nixpkgs/pkgs/applications/networking/cluster/glooctl/default.nix
2022-08-10 17:34:00 +00:00

37 lines
1018 B
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "glooctl";
version = "1.12.3";
src = fetchFromGitHub {
owner = "solo-io";
repo = "gloo";
rev = "v${version}";
hash = "sha256-0neq2EjlHddjLHyNlnqFjXCZpv8r7DGMeYNCzJUEFFg=";
};
subPackages = [ "projects/gloo/cli/cmd" ];
vendorSha256 = "sha256-1FbcNgTD5+YI29LOmkJMjhE+MnxrKmomTKK4DgyXCws=";
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
mv $out/bin/cmd $out/bin/glooctl
export HOME=$TMP
installShellCompletion --cmd glooctl \
--bash <($out/bin/glooctl completion bash) \
--zsh <($out/bin/glooctl completion zsh)
'';
ldflags = [ "-s" "-w" "-X github.com/solo-io/gloo/pkg/version.Version=${version}" ];
meta = with lib; {
description = "glooctl is the unified CLI for Gloo";
homepage = "https://docs.solo.io/gloo-edge/latest/reference/cli/glooctl/";
license = licenses.asl20;
maintainers = with maintainers; [ nelsonjeppesen ];
};
}