Commit ccc3646c6 for llama.cpp
commit ccc3646c63127e32ab8e2773290a1aded6dfb69c
Author: Zhaolun Yin <129580161+ZhaolunYin@users.noreply.github.com>
Date: Mon Sep 7 14:59:45 2026 +0100
nix : update deprecated expressions (#28145)
* fixed warnings
* fixed nixfmt warning
diff --git a/.devops/nix/package.nix b/.devops/nix/package.nix
index 86d9d589d..e807b4d71 100644
--- a/.devops/nix/package.nix
+++ b/.devops/nix/package.nix
@@ -31,7 +31,7 @@
]
&& blas.meta.available,
useCuda ? config.cudaSupport,
- useMetalKit ? stdenv.isAarch64 && stdenv.isDarwin,
+ useMetalKit ? stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isDarwin,
# Increases the runtime closure size by ~700M
useMpi ? false,
useRocm ? config.rocmSupport,
@@ -92,7 +92,7 @@ let
cudaBuildInputs = with cudaPackages; [
cuda_cudart
- cuda_cccl # <nv/target>
+ cccl # <nv/target>
libcublas
];
@@ -166,7 +166,7 @@ effectiveStdenv.mkDerivation (finalAttrs: {
# `xcrun` is used find the path of the Metal compiler, which is varible
# and not on $PATH
# see https://github.com/ggml-org/llama.cpp/pull/6118 for discussion
- __noChroot = effectiveStdenv.isDarwin && useMetalKit && precompileMetalShaders;
+ __noChroot = effectiveStdenv.hostPlatform.isDarwin && useMetalKit && precompileMetalShaders;
nativeBuildInputs =
[
@@ -181,10 +181,10 @@ effectiveStdenv.mkDerivation (finalAttrs: {
autoAddDriverRunpath
]
++ optionals (effectiveStdenv.hostPlatform.isGnu && enableStatic) [ glibc.static ]
- ++ optionals (effectiveStdenv.isDarwin && useMetalKit && precompileMetalShaders) [ xcrunHost ];
+ ++ optionals (effectiveStdenv.hostPlatform.isDarwin && useMetalKit && precompileMetalShaders) [ xcrunHost ];
buildInputs =
- optionals effectiveStdenv.isDarwin darwinBuildInputs
+ optionals effectiveStdenv.hostPlatform.isDarwin darwinBuildInputs
++ optionals useCuda cudaBuildInputs
++ optionals useMpi [ mpi ]
++ optionals useRocm rocmBuildInputs
@@ -245,7 +245,7 @@ effectiveStdenv.mkDerivation (finalAttrs: {
# Configurations that are known to result in build failures. Can be
# overridden by importing Nixpkgs with `allowBroken = true`.
- broken = (useMetalKit && !effectiveStdenv.isDarwin);
+ broken = (useMetalKit && !effectiveStdenv.hostPlatform.isDarwin);
description = "Inference of LLaMA model in pure C/C++${descriptionSuffix}";
homepage = "https://github.com/ggml-org/llama.cpp/";
diff --git a/flake.nix b/flake.nix
index bb02c8e52..6373d3b0b 100644
--- a/flake.nix
+++ b/flake.nix
@@ -128,7 +128,7 @@
}:
{
# For standardised reproducible formatting with `nix fmt`
- formatter = pkgs.nixfmt-rfc-style;
+ formatter = pkgs.nixfmt;
# Unlike `.#packages`, legacyPackages may contain values of
# arbitrary types (including nested attrsets) and may even throw
@@ -156,7 +156,7 @@
windows = config.legacyPackages.llamaPackagesWindows.llama-cpp;
python-scripts = config.legacyPackages.llamaPackages.python-scripts;
}
- // lib.optionalAttrs pkgs.stdenv.isLinux {
+ // lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
cuda = config.legacyPackages.llamaPackagesCuda.llama-cpp;
mpi-cpu = config.packages.default.override { useMpi = true; };