diff --git a/flake.nix b/flake.nix index 4178e97ff..1b3776e98 100644 --- a/flake.nix +++ b/flake.nix @@ -38,6 +38,16 @@ 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 + cp $src/llama-util.h $out/include + cp $src/ggml.h $out/include + cp $src/ggml-alloc.h $out/include + + cp $src/k_quants.h $out/include + cp $src/ggml-mpi.h $out/include ''; cmakeFlags = [ "-DLLAMA_BUILD_SERVER=ON" "-DLLAMA_MPI=ON" "-DBUILD_SHARED_LIBS=ON" "-DCMAKE_SKIP_BUILD_RPATH=ON" ]; in { @@ -55,7 +65,8 @@ "-DLLAMA_BLAS=ON" "-DLLAMA_BLAS_VENDOR=OpenBLAS" ]); - postInstall = postInstall; + postInstall = (if isAarch64 && isDarwin then + nixpkgs.lib.concatLines [postInstall "cp $src/ggml-metal.h $out/include"] else postInstall); meta.mainProgram = "llama"; }; packages.opencl = pkgs.stdenv.mkDerivation { @@ -67,7 +78,7 @@ cmakeFlags = cmakeFlags ++ [ "-DLLAMA_CLBLAST=ON" ]; - postInstall = postInstall; + postInstall = nixpkgs.lib.concatLines [postInstall "cp $src/ggml-opencl.h $out/include"]; meta.mainProgram = "llama"; }; apps.llama-server = {