From 92e4e57f997e35e3393cafe0cf59716553c97cf8 Mon Sep 17 00:00:00 2001 From: teto <886074+teto@users.noreply.github.com> Date: Fri, 12 Dec 2025 00:12:21 +0100 Subject: [PATCH] llama-cpp: add bash completion for the "llama-server" executable --- pkgs/by-name/ll/llama-cpp/package.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/by-name/ll/llama-cpp/package.nix b/pkgs/by-name/ll/llama-cpp/package.nix index 6737196f604f..3fb4b5c1479f 100644 --- a/pkgs/by-name/ll/llama-cpp/package.nix +++ b/pkgs/by-name/ll/llama-cpp/package.nix @@ -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";