Skip to content

Commit

Permalink
nix: use --system build flag instead of relying on $ZIG_GLOBAL_CACHE_…
Browse files Browse the repository at this point in the history
…DIR (#5434)

Fixes #5431
  • Loading branch information
mitchellh authored Jan 30, 2025
2 parents a62b26c + 4097341 commit adf4066
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions nix/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit adf4066

Please sign in to comment.