llama-cpp: add bash completion (#470244)

This commit is contained in:
Aleksana
2025-12-14 03:29:11 +00:00
committed by GitHub
+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";