depot/third_party/nixpkgs/pkgs/by-name/al/algolia-cli/package.nix
Default email 7e47f3658e Project import generated by Copybara.
GitOrigin-RevId: 1925c603f17fc89f4c8f6bf6f631a802ad85d784
2024-09-26 11:04:55 +00:00

47 lines
1 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
}:
let
version = "1.6.11";
in
buildGoModule {
pname = "algolia-cli";
inherit version;
src = fetchFromGitHub {
owner = "algolia";
repo = "cli";
rev = "v${version}";
hash = "sha256-VqY0h0Z3ocmgw0uFI4f6B5C/bTt3zoUXBlYPgOPxBo0=";
};
vendorHash = "sha256-cNuBTH7L2K4TgD0H9FZ9CjhE5AGXADaniGLD9Lhrtrk=";
nativeBuildInputs = [ installShellFiles ];
subPackages = [ "cmd/algolia" ];
ldflags = [
"-s"
"-w"
"-X github.com/algolia/cli/pkg/version.Version=${version}"
];
postInstall = ''
installShellCompletion --cmd algolia \
--bash <($out/bin/algolia completion bash) \
--fish <($out/bin/algolia completion fish) \
--zsh <($out/bin/algolia completion zsh)
'';
meta = {
description = "Algolias official CLI devtool";
mainProgram = "algolia";
homepage = "https://algolia.com/doc/tools/cli/";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ momeemt ];
};
}