about summary refs log tree commit diff
path: root/pkgs/by-name/ko/koboldcpp/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/ko/koboldcpp/package.nix')
-rw-r--r--pkgs/by-name/ko/koboldcpp/package.nix21
1 files changed, 13 insertions, 8 deletions
diff --git a/pkgs/by-name/ko/koboldcpp/package.nix b/pkgs/by-name/ko/koboldcpp/package.nix
index 85053dc716ce..40cc23278ea7 100644
--- a/pkgs/by-name/ko/koboldcpp/package.nix
+++ b/pkgs/by-name/ko/koboldcpp/package.nix
@@ -16,7 +16,7 @@
   config,
   cudaPackages ? { },
 
-  openblasSupport ? !stdenv.isDarwin,
+  openblasSupport ? !stdenv.hostPlatform.isDarwin,
   openblas,
 
   cublasSupport ? config.cudaSupport,
@@ -24,14 +24,14 @@
   # For example if you're on an GTX 1080 that means you're using "Pascal" and you need to pass "sm_60"
   cudaArches ? cudaPackages.cudaFlags.realArches or [ ],
 
-  clblastSupport ? stdenv.isLinux,
+  clblastSupport ? stdenv.hostPlatform.isLinux,
   clblast,
   ocl-icd,
 
   vulkanSupport ? true,
   vulkan-loader,
 
-  metalSupport ? stdenv.isDarwin && stdenv.isAarch64,
+  metalSupport ? stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64,
   march ? "",
   mtune ? "",
 }:
@@ -44,7 +44,7 @@ let
   '';
 
   darwinFrameworks =
-    if (stdenv.isDarwin && stdenv.isx86_64) then
+    if (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) then
       darwin.apple_sdk.frameworks
     else
       darwin.apple_sdk_11_0.frameworks;
@@ -53,13 +53,13 @@ let
 in
 effectiveStdenv.mkDerivation (finalAttrs: {
   pname = "koboldcpp";
-  version = "1.75.2";
+  version = "1.77";
 
   src = fetchFromGitHub {
     owner = "LostRuins";
     repo = "koboldcpp";
     rev = "refs/tags/v${finalAttrs.version}";
-    hash = "sha256-olMlYzde97RSx0OmDULSOFlM3imUq3AVxQdXyYBPd3Q=";
+    hash = "sha256-dyu//4LRjpdxkyA9M5yNDO0DA7inZZjH4pSkj6l2afk=";
   };
 
   enableParallelBuilding = true;
@@ -74,7 +74,7 @@ effectiveStdenv.mkDerivation (finalAttrs: {
   buildInputs =
     [ tk ]
     ++ finalAttrs.pythonInputs
-    ++ lib.optionals effectiveStdenv.isDarwin [
+    ++ lib.optionals effectiveStdenv.hostPlatform.isDarwin [
       darwinFrameworks.Accelerate
       darwinFrameworks.CoreVideo
       darwinFrameworks.CoreGraphics
@@ -100,7 +100,7 @@ effectiveStdenv.mkDerivation (finalAttrs: {
 
   pythonPath = finalAttrs.pythonInputs;
 
-  darwinLdFlags = lib.optionals stdenv.isDarwin [
+  darwinLdFlags = lib.optionals stdenv.hostPlatform.isDarwin [
     "-F${darwinFrameworks.CoreServices}/Library/Frameworks"
     "-F${darwinFrameworks.Accelerate}/Library/Frameworks"
     "-framework CoreServices"
@@ -141,6 +141,10 @@ effectiveStdenv.mkDerivation (finalAttrs: {
     cp *.so "$out/bin"
     cp *.embd "$out/bin"
 
+    ${lib.optionalString metalSupport ''
+      cp *.metal "$out/bin"
+    ''}
+
     ${lib.optionalString (!koboldLiteSupport) ''
       rm "$out/bin/kcpp_docs.embd"
       rm "$out/bin/klite.embd"
@@ -166,6 +170,7 @@ effectiveStdenv.mkDerivation (finalAttrs: {
   meta = {
     changelog = "https://github.com/LostRuins/koboldcpp/releases/tag/v${finalAttrs.version}";
     description = "Way to run various GGML and GGUF models";
+    homepage = "https://github.com/LostRuins/koboldcpp";
     license = lib.licenses.agpl3Only;
     mainProgram = "koboldcpp";
     maintainers = with lib.maintainers; [