summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.devops/nix/package.nix6
-rw-r--r--flake.nix3
2 files changed, 7 insertions, 2 deletions
diff --git a/.devops/nix/package.nix b/.devops/nix/package.nix
index b651f9e6..83858c82 100644
--- a/.devops/nix/package.nix
+++ b/.devops/nix/package.nix
@@ -67,6 +67,8 @@ let
strings.optionalString (suffices != [ ])
", accelerated with ${strings.concatStringsSep ", " suffices}";
+ executableSuffix = effectiveStdenv.hostPlatform.extensions.executable;
+
# TODO: package the Python in this repository in a Nix-like way.
# It'd be nice to migrate to buildPythonPackage, as well as ensure this repo
# is PEP 517-compatible, and ensure the correct .dist-info is generated.
@@ -244,8 +246,8 @@ effectiveStdenv.mkDerivation (
# TODO(SomeoneSerge): It's better to add proper install targets at the CMake level,
# if they haven't been added yet.
postInstall = ''
- mv $out/bin/main $out/bin/llama
- mv $out/bin/server $out/bin/llama-server
+ mv $out/bin/main${executableSuffix} $out/bin/llama${executableSuffix}
+ mv $out/bin/server${executableSuffix} $out/bin/llama-server${executableSuffix}
mkdir -p $out/include
cp $src/llama.h $out/include/
'';
diff --git a/flake.nix b/flake.nix
index 9a528a66..cdce3e0a 100644
--- a/flake.nix
+++ b/flake.nix
@@ -155,6 +155,9 @@
{
default = config.legacyPackages.llamaPackages.llama-cpp;
vulkan = config.packages.default.override { useVulkan = true; };
+ windows = config.legacyPackages.llamaPackages.llama-cpp.override {
+ stdenv = pkgs.pkgsCross.mingwW64.stdenv;
+ };
}
// lib.optionalAttrs pkgs.stdenv.isLinux {
opencl = config.packages.default.override { useOpenCL = true; };