llama-cpp: add bash completion

for the "llama-server" executable
This commit is contained in:
teto
2025-12-13 16:53:27 +01:00
parent 0a37cc8d03
commit 92e4e57f99
+6
View File
@@ -3,6 +3,7 @@
autoAddDriverRunpath,
cmake,
fetchFromGitHub,
installShellFiles,
nix-update-script,
stdenv,
@@ -89,6 +90,7 @@ effectiveStdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [
cmake
installShellFiles
ninja
pkg-config
]
@@ -151,6 +153,10 @@ effectiveStdenv.mkDerivation (finalAttrs: {
mkdir -p $out/include
cp $src/include/llama.h $out/include/
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd llama-server --bash <($out/bin/llama-server --completion-bash)
''
+ optionalString rpcSupport "cp bin/rpc-server $out/bin/llama-rpc-server";