2024-09-26 11:04:55 +00:00
|
|
|
|
{
|
|
|
|
|
lib,
|
|
|
|
|
buildGoModule,
|
|
|
|
|
fetchFromGitHub,
|
|
|
|
|
installShellFiles,
|
|
|
|
|
}:
|
|
|
|
|
let
|
2024-06-05 15:53:02 +00:00
|
|
|
|
version = "1.6.11";
|
2024-09-26 11:04:55 +00:00
|
|
|
|
in
|
|
|
|
|
buildGoModule {
|
|
|
|
|
pname = "algolia-cli";
|
|
|
|
|
inherit version;
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "algolia";
|
|
|
|
|
repo = "cli";
|
|
|
|
|
rev = "v${version}";
|
2024-06-05 15:53:02 +00:00
|
|
|
|
hash = "sha256-VqY0h0Z3ocmgw0uFI4f6B5C/bTt3zoUXBlYPgOPxBo0=";
|
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" ];
|
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
|
ldflags = [
|
|
|
|
|
"-s"
|
|
|
|
|
"-w"
|
|
|
|
|
"-X github.com/algolia/cli/pkg/version.Version=${version}"
|
|
|
|
|
];
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
|
installShellCompletion --cmd algolia \
|
|
|
|
|
--bash <($out/bin/algolia completion bash) \
|
|
|
|
|
--fish <($out/bin/algolia completion fish) \
|
|
|
|
|
--zsh <($out/bin/algolia completion zsh)
|
|
|
|
|
'';
|
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
|
meta = {
|
2023-02-02 18:25:31 +00:00
|
|
|
|
description = "Algolia’s official CLI devtool";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
mainProgram = "algolia";
|
2023-02-02 18:25:31 +00:00
|
|
|
|
homepage = "https://algolia.com/doc/tools/cli/";
|
2024-09-26 11:04:55 +00:00
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
|
maintainers = with lib.maintainers; [ momeemt ];
|
2023-02-02 18:25:31 +00:00
|
|
|
|
};
|
|
|
|
|
}
|