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, rustPlatform,
fetchFromGitHub, fetchFromGitHub,
makeBinaryWrapper, makeBinaryWrapper,
installShellFiles,
versionCheckHook, versionCheckHook,
nix-update-script, nix-update-script,
}: }:
@@ -20,13 +21,22 @@ rustPlatform.buildRustPackage {
hash = "sha256-/6p23JW3ZaSuDf34IWcTggR92/zUTMRerQ32bTsRujo="; hash = "sha256-/6p23JW3ZaSuDf34IWcTggR92/zUTMRerQ32bTsRujo=";
}; };
nativeBuildInputs = [ makeBinaryWrapper ]; nativeBuildInputs = [
makeBinaryWrapper
installShellFiles
];
useFetchCargoVendor = true; useFetchCargoVendor = true;
cargoHash = "sha256-aX8nm/V0ug2g40QeFU9AWxjuFAnW+gYTR8RC5CV7wRQ="; cargoHash = "sha256-aX8nm/V0ug2g40QeFU9AWxjuFAnW+gYTR8RC5CV7wRQ=";
cargoBuildFlags = [ "--workspace" ]; 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 = '' postFixup = ''
wrapProgram $out/bin/lla \ wrapProgram $out/bin/lla \
--add-flags "--plugins-dir $out/lib" --add-flags "--plugins-dir $out/lib"