2023-02-02 18:25:31 +00:00
|
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
|
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
|
pname = "algolia-cli";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
version = "1.3.7";
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "algolia";
|
|
|
|
|
repo = "cli";
|
|
|
|
|
rev = "v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
hash = "sha256-Mg8GSomBP0jt+16S18tOq2f7HkVpCZbNz/A/g9Afk/I=";
|
2023-02-02 18:25:31 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
|
vendorHash = "sha256-cNuBTH7L2K4TgD0H9FZ9CjhE5AGXADaniGLD9Lhrtrk=";
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
|
|
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 = with lib; {
|
|
|
|
|
description = "Algolia’s official CLI devtool";
|
|
|
|
|
homepage = "https://algolia.com/doc/tools/cli/";
|
|
|
|
|
license = licenses.mit;
|
|
|
|
|
maintainers = [ maintainers.marsam ];
|
|
|
|
|
};
|
|
|
|
|
}
|