diff --git a/flake.nix b/flake.nix index fbad5ba..e4570c2 100644 --- a/flake.nix +++ b/flake.nix @@ -15,9 +15,18 @@ in (flake-utils.lib.eachDefaultSystem (system: let # Fix zig to handle tar extraction in Docker containers zigFixed = zig2nix.outputs.packages.${system}.zig-latest.overrideAttrs (oldAttrs: { - # Set TAR_OPTIONS for the unpack phase to avoid ownership issues - preUnpack = '' - export TAR_OPTIONS="--no-same-owner" + # Override the unpack phase to use --no-same-owner + unpackPhase = '' + runHook preUnpack + + # Extract with --no-same-owner to avoid permission issues in Docker + tar xf $src --no-same-owner + + # Set sourceRoot to the extracted directory + sourceRoot=$(ls -d */ | head -n 1) + sourceRoot=''${sourceRoot%/} + + runHook postUnpack ''; }); # Zig flake helper