2023-02-02 18:25:31 +00:00
|
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
|
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
|
pname = "algolia-cli";
|
2023-03-27 19:17:25 +00:00
|
|
|
|
version = "1.3.2";
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "algolia";
|
|
|
|
|
repo = "cli";
|
|
|
|
|
rev = "v${version}";
|
2023-03-27 19:17:25 +00:00
|
|
|
|
hash = "sha256-l0AIAg68HR8sD1l978OW3H7nnQbIrxtXqo2/rWTZJmY=";
|
2023-02-02 18:25:31 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
|
vendorHash = "sha256-t8SqCBuE/JmVR71MC9sHtQ6tEovO2UJo7FCDM+IBk+c=";
|
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 ];
|
|
|
|
|
};
|
|
|
|
|
}
|