mdsf: add shell completions (#453880)

This commit is contained in:
Sandro
2025-10-23 18:53:28 +00:00
committed by GitHub
+13
View File
@@ -1,9 +1,11 @@
{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
versionCheckHook,
nix-update-script,
installShellFiles,
}:
let
pname = "mdsf";
@@ -24,6 +26,17 @@ rustPlatform.buildRustPackage {
# many tests fail for various reasons of which most depend on the build sandbox
doCheck = false;
nativeBuildInputs = [
installShellFiles
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd mdsf \
--bash <($out/bin/mdsf completions bash) \
--zsh <($out/bin/mdsf completions zsh) \
--fish <($out/bin/mdsf completions fish) \
--nushell <($out/bin/mdsf completions nushell)
'';
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
passthru.updateScript = nix-update-script { };