about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/op/opensearch-cli/package.nix
blob: ce0a671358045efe30903f753f66f60c318e92be (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:

buildGoModule rec {
  pname = "opensearch-cli";
  version = "1.2.0";
  src = fetchFromGitHub {
    repo = "opensearch-cli";
    owner = "opensearch-project";
    rev = version;
    hash = "sha256-Ah64a9hpc2tnIXiwxg/slE6fUTAoHv9koNmlUHrVj/s=";
  };

  vendorHash = "sha256-r3Bnud8pd0Z9XmGkj9yxRW4U/Ry4U8gvVF4pAdN14lQ=";

  nativeBuildInputs = [ installShellFiles ];

  postInstall = ''
    export HOME="$(mktemp -d)"
    installShellCompletion --cmd opensearch-cli \
      --bash <($out/bin/opensearch-cli completion bash) \
      --zsh <($out/bin/opensearch-cli completion zsh) \
      --fish <($out/bin/opensearch-cli completion fish)
  '';

  meta = {
    description = "A full-featured command line interface (CLI) for OpenSearch.";
    homepage = "https://github.com/opensearch-project/opensearch-cli";
    license = lib.licenses.asl20;
    mainProgram = "opensearch-cli";
    maintainers = with lib.maintainers; [ shyim ];
    platforms = lib.platforms.unix;
    sourceProvenance = with lib.sourceTypes; [ fromSource ];
  };
}