diff options
Diffstat (limited to 'pkgs/by-name/ol/ollama/package.nix')
-rw-r--r-- | pkgs/by-name/ol/ollama/package.nix | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/pkgs/by-name/ol/ollama/package.nix b/pkgs/by-name/ol/ollama/package.nix index f161033824949..ababb3f68a70f 100644 --- a/pkgs/by-name/ol/ollama/package.nix +++ b/pkgs/by-name/ol/ollama/package.nix @@ -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,7 +212,7 @@ 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; |