diff options
Diffstat (limited to 'pkgs/by-name/ol/ollama/package.nix')
-rw-r--r-- | pkgs/by-name/ol/ollama/package.nix | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/pkgs/by-name/ol/ollama/package.nix b/pkgs/by-name/ol/ollama/package.nix index f16103382494..78eda05aaf57 100644 --- a/pkgs/by-name/ol/ollama/package.nix +++ b/pkgs/by-name/ol/ollama/package.nix @@ -40,13 +40,13 @@ assert builtins.elem acceleration [ let pname = "ollama"; # don't forget to invalidate all hashes each update - version = "0.3.11"; + version = "0.3.12"; src = fetchFromGitHub { owner = "ollama"; repo = "ollama"; rev = "v${version}"; - hash = "sha256-YYrNrlXL6ytLfnrvSHybi0va0lvgVNuIRP+IFE5XZX8="; + hash = "sha256-K1FYXEP0bTZa8M+V4/SxI+Q+LWs2rsAMZ/ETJCaO7P8="; fetchSubmodules = true; }; @@ -62,8 +62,8 @@ let rocmRequested = shouldEnable "rocm" config.rocmSupport; cudaRequested = shouldEnable "cuda" config.cudaSupport; - enableRocm = rocmRequested && stdenv.isLinux; - enableCuda = cudaRequested && stdenv.isLinux; + enableRocm = rocmRequested && stdenv.hostPlatform.isLinux; + enableCuda = cudaRequested && stdenv.hostPlatform.isLinux; rocmLibs = [ rocmPackages.clr @@ -144,12 +144,12 @@ goBuild { makeWrapper autoAddDriverRunpath ] - ++ lib.optionals stdenv.isDarwin metalFrameworks; + ++ lib.optionals stdenv.hostPlatform.isDarwin metalFrameworks; buildInputs = lib.optionals enableRocm (rocmLibs ++ [ libdrm ]) ++ lib.optionals enableCuda cudaLibs - ++ lib.optionals stdenv.isDarwin metalFrameworks; + ++ lib.optionals stdenv.hostPlatform.isDarwin metalFrameworks; patches = [ # disable uses of `git` in the `go generate` script @@ -157,6 +157,9 @@ goBuild { # this also disables necessary patches contained in `ollama/llm/patches/` # those patches are applied in `postPatch` ./disable-git.patch + + # we provide our own deps at runtime + ./skip-rocm-cp.patch ]; postPatch = '' @@ -209,15 +212,13 @@ goBuild { package = ollama; }; } - // lib.optionalAttrs stdenv.isLinux { + // lib.optionalAttrs stdenv.hostPlatform.isLinux { inherit ollama-rocm ollama-cuda; service = nixosTests.ollama; service-cuda = nixosTests.ollama-cuda; service-rocm = nixosTests.ollama-rocm; }; - - updateScript = nix-update-script { }; - }; + } // lib.optionalAttrs (!enableRocm && !enableCuda) { updateScript = nix-update-script { }; }; meta = { description = |