From 08cc6338d8c216699a3751f5295fe2a4fc0bb1bc Mon Sep 17 00:00:00 2001 From: "Nurul Huda (Apon)" Date: Sun, 31 May 2026 16:25:47 +0600 Subject: [PATCH] chore: fix flake.nix for zig 0.16 --- flake.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 2a6a7900..364c91bd 100644 --- a/flake.nix +++ b/flake.nix @@ -13,7 +13,6 @@ with nixpkgs.lib; let forAllSystems = f: genAttrs systems.flakeExposed (s: f nixpkgs.legacyPackages.${s}); - src = cleanSource ./.; in { apps = forAllSystems (pkgs: { default = { @@ -25,8 +24,11 @@ text = '' tmp="$(mktemp -d)" trap 'rm -rf "$tmp"' EXIT - (cd "${src}" && ZIG_LOCAL_CACHE_DIR="$tmp" zig build -p "$tmp" -Doptimize=Debug -Dexclude-lsp=true) - "$tmp/bin/zx" "$@" + export ZIG_LOCAL_CACHE_DIR="$tmp/cache" + export ZIG_GLOBAL_CACHE_DIR="$tmp/cache" + mkdir -p "$ZIG_LOCAL_CACHE_DIR" + zig build -p "$tmp/out" -Doptimize=Debug -Dexclude-lsp=true + "$tmp/out/bin/zx" "$@" ''; }) + "/bin/zx"; };