From 275411d99d123478fad2c77b916cf7c886f41d38 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Tue, 2 Dec 2025 11:22:32 -0500 Subject: [PATCH] ollama: fix build on darwin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The app dir is a GUI app for macOS and Windows that was added, it doesn’t build, so simply omit it (Homebrew does the same, FWIW). Two test files are failing due to an inability to initialize Metal (presumably due to sandboxing), so disable them. --- pkgs/by-name/ol/ollama/package.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/by-name/ol/ollama/package.nix b/pkgs/by-name/ol/ollama/package.nix index b8157801d5de..c4a8dc078012 100644 --- a/pkgs/by-name/ol/ollama/package.nix +++ b/pkgs/by-name/ol/ollama/package.nix @@ -187,6 +187,12 @@ goBuild (finalAttrs: { postPatch = '' substituteInPlace version/version.go \ --replace-fail 0.0.0 '${finalAttrs.version}' + rm -r app + '' + # disable tests that fail in sandbox due to Metal init failure + + lib.optionalString stdenv.hostPlatform.isDarwin '' + rm ml/backend/ggml/ggml_test.go + rm ml/nn/pooling/pooling_test.go ''; overrideModAttrs = (