ollama: don't build llama.cpp twice

buildGoModules runs preBuild hooks in the module download fixed-output
derivation, so llama.cpp got built and immediately discarded, to then
immediately be built again for the actual Go build.
This commit is contained in:
edef 2024-09-11 07:39:52 +00:00
parent 8c116c6112
commit 0eb5526b69

View File

@ -181,6 +181,14 @@ goBuild (
# replace inaccurate version number with actual release version
substituteInPlace version/version.go --replace-fail 0.0.0 '${version}'
'';
overrideModAttrs = (
finalAttrs: prevAttrs: {
# don't run llama.cpp build in the module fetch phase
preBuild = "";
}
);
preBuild = ''
# disable uses of `git`, since nix removes the git directory
export OLLAMA_SKIP_PATCHING=true