From a2b16d6172c8f8c49e05d8f94b205a4f2fa53a42 Mon Sep 17 00:00:00 2001 From: William Behrens <35979547+wbehrens-on-gh@users.noreply.github.com> Date: Fri, 11 Aug 2023 20:45:33 -0500 Subject: [PATCH] Allow for metal development in nix package --- flake.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index a7111ad13..0953d69a5 100644 --- a/flake.nix +++ b/flake.nix @@ -38,7 +38,7 @@ postInstall = '' mv $out/bin/main $out/bin/llama mv $out/bin/server $out/bin/llama-server - + mkdir $out/include cp $src/llama.h $out/include @@ -67,7 +67,11 @@ "-DLLAMA_BLAS_VENDOR=OpenBLAS" ]); postInstall = (if isAarch64 && isDarwin then - nixpkgs.lib.concatLines [postInstall "cp $src/ggml-metal.h $out/include"] else postInstall); + nixpkgs.lib.concatLines [ + postInstall + "cp $src/ggml-metal.h $out/include" + "cp $src/ggml-metal.metal $out/bin" + ] else postInstall); meta.mainProgram = "llama"; }; packages.opencl = pkgs.stdenv.mkDerivation {