From 40973417d040135be6740ab7cf4a4e2d0f85fe81 Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Thu, 30 Jan 2025 10:16:45 -0600 Subject: [PATCH] nix: use --system build flag instead of relying on $ZIG_GLOBAL_CACHE_DIR Fixes #5431 --- nix/package.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/nix/package.nix b/nix/package.nix index 2f7825a562..0974ff9c96 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -40,7 +40,7 @@ # ultimately acted on and has made its way to a nixpkgs implementation, this # can probably be removed in favor of that. zig_hook = zig_0_13.hook.overrideAttrs { - zig_default_flags = "-Dcpu=baseline -Doptimize=${optimize}"; + zig_default_flags = "-Dcpu=baseline -Doptimize=${optimize} --color off"; }; # We limit source like this to try and reduce the amount of rebuilds as possible @@ -162,13 +162,13 @@ in dontConfigure = true; - zigBuildFlags = "-Dversion-string=${finalAttrs.version}-${revision}-nix -Dgtk-x11=${lib.boolToString enableX11} -Dgtk-wayland=${lib.boolToString enableWayland}"; - - preBuild = '' - rm -rf $ZIG_GLOBAL_CACHE_DIR - cp -r --reflink=auto ${zigCache} $ZIG_GLOBAL_CACHE_DIR - chmod u+rwX -R $ZIG_GLOBAL_CACHE_DIR - ''; + zigBuildFlags = [ + "--system" + "${zigCache}/p" + "-Dversion-string=${finalAttrs.version}-${revision}-nix" + "-Dgtk-x11=${lib.boolToString enableX11}" + "-Dgtk-wayland=${lib.boolToString enableWayland}" + ]; outputs = [ "out"