diff --git a/flake.nix b/flake.nix index 7a7c7b4..5c80e09 100644 --- a/flake.nix +++ b/flake.nix @@ -83,17 +83,19 @@ pkgs.stdenvNoCC.mkDerivation { inherit src; name = "hostapps-zig-cache"; - buildInputs = [ - pkgs.zig_0_12 - ]; - dontUseZigInstall = true; - dontUseZigBuild = true; + nativeBuildInputs = [pkgs.git pkgs.zig_0_12.hook]; + # buildInputs = [ + # pkgs.zig_0_12 + # ]; + dontConfigure = true; + dontUseZigBuild = true; + dontUseZigInstall = true; dontFixup = true; - preBuild = '' - export ZIG_GLOBAL_CACHE_DIR=$(mktemp -d) - ''; + # preBuild = '' + # export ZIG_GLOBAL_CACHE_DIR=$(mktemp -d) + # ''; buildPhase = '' runHook preBuild @@ -103,7 +105,7 @@ installPhase = '' runHook preInstall - cp -r --reflink=auto $ZIG_GLOBAL_CACHE_DIR/p $out + cp -r --reflink=auto $ZIG_GLOBAL_CACHE_DIR $out runHook postInstall ''; outputHash = "sha256-1RX8LJCu8jfGOfHj0uQrVk4ltjVm/q7YyH4EfDmsG1c="; @@ -117,28 +119,33 @@ src = ./.; - buildInputs = [ - pkgs.zig_0_12 + nativeBuildInputs = [ + pkgs.git + pkgs.zig_0_12.hook ]; + # buildInputs = [ + # pkgs.zig_0_12 + # ]; + preBuild = '' - export ZIG_GLOBAL_CACHE_DIR=$(mktemp -d) - cp -r --reflink=auto ${cache attrs.src} $ZIG_GLOBAL_CACHE_DIR/p + rm -rf $ZIG_GLOBAL_CACHE_DIR + cp -r --reflink=auto ${cache attrs.src} $ZIG_GLOBAL_CACHE_DIR chmod -R u+rwX $ZIG_GLOBAL_CACHE_DIR ''; - buildPhase = '' - runHook preBuild - zig build -Doptimize=ReleaseSafe - runHook postBuild - ''; + # buildPhase = '' + # runHook preBuild + # zig build -Doptimize=ReleaseSafe + # runHook postBuild + # ''; - installPhase = '' - runHook preInstall - mkdir -p $out/bin - cp zig-out/bin/hostapps $out/bin - runHook postInstall - ''; + # installPhase = '' + # runHook preInstall + # mkdir -p $out/bin + # cp zig-out/bin/hostapps $out/bin + # runHook postInstall + # ''; } ); };