lla: add shell completions (#368049)

This commit is contained in:
Aleksana
2025-04-17 10:06:26 +08:00
committed by GitHub

View File

@@ -3,6 +3,7 @@
rustPlatform,
fetchFromGitHub,
makeBinaryWrapper,
installShellFiles,
versionCheckHook,
nix-update-script,
}:
@@ -20,13 +21,22 @@ rustPlatform.buildRustPackage {
hash = "sha256-/6p23JW3ZaSuDf34IWcTggR92/zUTMRerQ32bTsRujo=";
};
nativeBuildInputs = [ makeBinaryWrapper ];
nativeBuildInputs = [
makeBinaryWrapper
installShellFiles
];
useFetchCargoVendor = true;
cargoHash = "sha256-aX8nm/V0ug2g40QeFU9AWxjuFAnW+gYTR8RC5CV7wRQ=";
cargoBuildFlags = [ "--workspace" ];
# TODO: Upstream also provides Elvish and PowerShell completions,
# but `installShellCompletion` only has support for Bash, Zsh and Fish at the moment.
postInstall = ''
installShellCompletion completions/{_lla,lla{.bash,.fish}}
'';
postFixup = ''
wrapProgram $out/bin/lla \
--add-flags "--plugins-dir $out/lib"