From 76318c59413efd2243f31f1e34a3ccbb061f668c Mon Sep 17 00:00:00 2001 From: Leah Amelia Chen Date: Wed, 25 Dec 2024 10:05:07 +0800 Subject: [PATCH] lla: add shell completions --- pkgs/by-name/ll/lla/package.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ll/lla/package.nix b/pkgs/by-name/ll/lla/package.nix index 5896c4336bcc..0323e2b709d0 100644 --- a/pkgs/by-name/ll/lla/package.nix +++ b/pkgs/by-name/ll/lla/package.nix @@ -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"