mago: install shell completions
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
rustPlatform,
|
||||
fetchFromGitHub,
|
||||
installShellFiles,
|
||||
pkg-config,
|
||||
openssl,
|
||||
versionCheckHook,
|
||||
@@ -26,10 +28,20 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
OPENSSL_NO_VENDOR = 1;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [ openssl ];
|
||||
|
||||
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
installShellCompletion --cmd mago \
|
||||
--bash <("$out/bin/mago" generate-completions bash) \
|
||||
--zsh <("$out/bin/mago" generate-completions zsh) \
|
||||
--fish <("$out/bin/mago" generate-completions fish)
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user