diff --git a/pkgs/by-name/md/mdsf/package.nix b/pkgs/by-name/md/mdsf/package.nix index 6287cb4e821d..cfe185d988f4 100644 --- a/pkgs/by-name/md/mdsf/package.nix +++ b/pkgs/by-name/md/mdsf/package.nix @@ -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 { };