From 0c0ef784a353fa8661c71833b1182654839f2934 Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Thu, 19 Sep 2024 09:26:49 -0400 Subject: [PATCH 1/2] ollama: add updateScript --- pkgs/by-name/ol/ollama/package.nix | 31 +++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/pkgs/by-name/ol/ollama/package.nix b/pkgs/by-name/ol/ollama/package.nix index d11e06833efc..c7cdca1891a2 100644 --- a/pkgs/by-name/ol/ollama/package.nix +++ b/pkgs/by-name/ol/ollama/package.nix @@ -8,6 +8,7 @@ makeWrapper, stdenv, addDriverRunpath, + nix-update-script, cmake, gcc12, @@ -199,20 +200,24 @@ goBuild { "-X=github.com/ollama/ollama/server.mode=release" ]; - passthru.tests = - { - inherit ollama; - version = testers.testVersion { - inherit version; - package = ollama; + passthru = { + tests = + { + inherit ollama; + version = testers.testVersion { + inherit version; + package = ollama; + }; + } + // lib.optionalAttrs stdenv.isLinux { + inherit ollama-rocm ollama-cuda; + service = nixosTests.ollama; + service-cuda = nixosTests.ollama-cuda; + service-rocm = nixosTests.ollama-rocm; }; - } - // lib.optionalAttrs stdenv.isLinux { - inherit ollama-rocm ollama-cuda; - service = nixosTests.ollama; - service-cuda = nixosTests.ollama-cuda; - service-rocm = nixosTests.ollama-rocm; - }; + + updateScript = nix-update-script { }; + }; meta = { description = From 4a150a2dd29f8ff75e64d8f9f12f6f215bd96197 Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Thu, 19 Sep 2024 09:27:19 -0400 Subject: [PATCH 2/2] ollama: 0.3.10 -> 0.3.11 --- pkgs/by-name/ol/ollama/disable-git.patch | 16 +++++++++------- pkgs/by-name/ol/ollama/package.nix | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/ol/ollama/disable-git.patch b/pkgs/by-name/ol/ollama/disable-git.patch index 5f9b4b3323b6..5248905302dc 100644 --- a/pkgs/by-name/ol/ollama/disable-git.patch +++ b/pkgs/by-name/ol/ollama/disable-git.patch @@ -1,15 +1,17 @@ +diff --git a/llm/generate/gen_common.sh b/llm/generate/gen_common.sh +index 3825c155..d22eccd2 100644 --- a/llm/generate/gen_common.sh +++ b/llm/generate/gen_common.sh -@@ -65,6 +65,8 @@ - echo 'add_subdirectory(../ext_server ext_server) # ollama' >>${LLAMACPP_DIR}/CMakeLists.txt - fi +@@ -69,6 +69,8 @@ git_module_setup() { + } + apply_patches() { + return + - if [ -n "$(ls -A ../patches/*.diff)" ]; then - # apply temporary patches until fix is upstream - for patch in ../patches/*.diff; do -@@ -110,6 +112,8 @@ + # apply temporary patches until fix is upstream + for patch in ../patches/*.patch; do + git -c 'user.name=nobody' -c 'user.email=<>' -C ${LLAMACPP_DIR} am ${patch} +@@ -133,6 +135,8 @@ install() { # Keep the local tree clean after we're done with the build cleanup() { diff --git a/pkgs/by-name/ol/ollama/package.nix b/pkgs/by-name/ol/ollama/package.nix index c7cdca1891a2..f16103382494 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.10"; + version = "0.3.11"; src = fetchFromGitHub { owner = "ollama"; repo = "ollama"; rev = "v${version}"; - hash = "sha256-iNjqnhiM0L873BiBPAgI2Y0KEQyCInn2nEihzwLasFU="; + hash = "sha256-YYrNrlXL6ytLfnrvSHybi0va0lvgVNuIRP+IFE5XZX8="; fetchSubmodules = true; };