From ccc3646c63127e32ab8e2773290a1aded6dfb69c Mon Sep 17 00:00:00 2001 From: Zhaolun Yin <129580161+ZhaolunYin@users.noreply.github.com> Date: Mon, 7 Sep 2026 14:59:45 +0100 Subject: [PATCH] nix : update deprecated expressions (#28145) * fixed warnings * fixed nixfmt warning --- .devops/nix/package.nix | 12 ++++++------ flake.nix | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) 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 # + cccl # 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; };