43 lines
971 B
Nix
43 lines
971 B
Nix
{
|
|
lib,
|
|
buildNpmPackage,
|
|
fetchFromGitHub,
|
|
}:
|
|
|
|
buildNpmPackage (finalAttrs: {
|
|
pname = "llama-cpp-nightly-ui";
|
|
version = "9222";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ggml-org";
|
|
repo = "llama.cpp";
|
|
tag = "b${finalAttrs.version}";
|
|
hash = "sha256-Ws0a2qkgTFoeUuzg6tKbY6PfDP+0/9D9DTx21fLoFak=";
|
|
};
|
|
|
|
sourceRoot = "source/tools/ui";
|
|
|
|
npmDepsHash = "sha256-Po5SWJv3vmcBR7y62G9/CfvI3Lk/MYdjFMTTy2dsgoY=";
|
|
|
|
postPatch = ''
|
|
substituteInPlace svelte.config.js \
|
|
--replace-fail "../../build/tools/ui/dist" "./dist"
|
|
substituteInPlace scripts/vite-plugin-llama-cpp-build.ts \
|
|
--replace-fail "../../build/tools/ui/dist" "./dist"
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
mkdir $out
|
|
cp dist/* $out/
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = {
|
|
description = "Web UI for llama.cpp server";
|
|
homepage = "https://github.com/ggml-org/llama.cpp";
|
|
license = lib.licenses.mit;
|
|
platforms = lib.platforms.unix;
|
|
};
|
|
})
|