vector: Install shell completions

Reference: https://github.com/vectordotdev/vector/issues/24513
This commit is contained in:
Jonathan Davies
2026-01-28 21:15:30 +00:00
parent 8da4a40999
commit 980cec0f03
+8
View File
@@ -2,6 +2,7 @@
stdenv,
lib,
fetchFromGitHub,
installShellFiles,
rustPlatform,
pkg-config,
openssl,
@@ -43,6 +44,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
perl
git
rustPlatform.bindgenHook
installShellFiles
]
# Provides the mig command used by the build scripts
++ lib.optional stdenv.hostPlatform.isDarwin darwin.bootstrap_cmds;
@@ -116,6 +118,12 @@ rustPlatform.buildRustPackage (finalAttrs: {
--replace-fail "#[tokio::test]" ""
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
for shell in bash fish zsh; do
installShellCompletion --cmd vector --$shell <($out/bin/vector completion $shell)
done
'';
nativeInstallCheckInputs = [
versionCheckHook
];