vector: Install shell completions
Reference: https://github.com/vectordotdev/vector/issues/24513
This commit is contained in:
@@ -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
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user