Merge pull request #323666 from hakantunc/influxdb2-cli-install-shell-completion

influxdb2-cli: install shell completion
This commit is contained in:
Aleksana 2024-07-12 17:58:00 +08:00 committed by GitHub
commit 08c4339c15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,8 @@
{ buildGoModule
, fetchFromGitHub
, installShellFiles
, lib
, stdenv
}:
let
@ -18,11 +20,19 @@ in buildGoModule {
version = version;
inherit src;
nativeBuildInputs = [ installShellFiles ];
vendorHash = "sha256-Ov0TPoMm0qi7kkWUUni677sCP1LwkT9+n3KHcAlQkDA=";
subPackages = [ "cmd/influx" ];
ldflags = [ "-X main.commit=v${version}" "-X main.version=${version}" ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd influx \
--bash <($out/bin/influx completion bash) \
--zsh <($out/bin/influx completion zsh)
'';
meta = with lib; {
description = "CLI for managing resources in InfluxDB v2";
license = licenses.mit;