nixpkgs/pkgs/applications/networking/cluster/glooctl/default.nix
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00

47 lines
1 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:
buildGoModule rec {
pname = "glooctl";
version = "1.16.8";
src = fetchFromGitHub {
owner = "solo-io";
repo = "gloo";
rev = "v${version}";
hash = "sha256-M8ZNDt+sO8ZtVM1PyISOsFwXrD6q9ACPG0T99bqwk1c=";
};
vendorHash = "sha256-UyzqKpF2WBj25Bm4MtkF6yjl87A61vGsteBNCjJV178=";
subPackages = [ "projects/gloo/cli/cmd" ];
nativeBuildInputs = [ installShellFiles ];
strictDeps = true;
ldflags = [
"-s"
"-w"
"-X github.com/solo-io/gloo/pkg/version.Version=${version}"
];
postInstall = ''
mv $out/bin/cmd $out/bin/glooctl
installShellCompletion --cmd glooctl \
--bash <($out/bin/glooctl completion bash) \
--zsh <($out/bin/glooctl completion zsh)
'';
meta = {
description = "glooctl is the unified CLI for Gloo";
mainProgram = "glooctl";
homepage = "https://docs.solo.io/gloo-edge/latest/reference/cli/glooctl/";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ ];
};
}