From 6021691b3f0e2e07f8a6c2ea7ff5a4c2037f5d5d Mon Sep 17 00:00:00 2001 From: Sovran Systems <99053422+naturallaw777@users.noreply.github.com> Date: Mon, 10 Aug 2026 17:11:30 -0500 Subject: [PATCH] =?UTF-8?q?Mempool:=20fix=20npmDeps=20fetcher=20=E2=80=94?= =?UTF-8?q?=20postUnpack=20instead=20of=20sourceRoot,=20postPatch=20instea?= =?UTF-8?q?d=20of=20patches?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `patches` attribute was being applied inside the npmDeps fixed-output derivation where patch runs interactively and fails. sourceRoot also caused the deps fetcher to hash a different tree than expected. Now: - postUnpack cds into the subdir for both the fetcher and main build - postPatch applies the mining-pool patch only in the main build - npmDepsHash values remain placeholders (lib.fakeHash) --- packages/mempool/default.nix | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/mempool/default.nix b/packages/mempool/default.nix index a04abbe..192129c 100644 --- a/packages/mempool/default.nix +++ b/packages/mempool/default.nix @@ -80,19 +80,26 @@ in rec { pname = "mempool-backend"; inherit version src; - sourceRoot = "source/backend"; + # Use postUnpack (not sourceRoot) so the npmDeps fixed-output + # derivation hashes the same unpacked tree as the main build. + postUnpack = '' + cd source/backend + ''; # Placeholder: build once, then replace with the hash from the # "hash mismatch" error output. npmDepsHash = lib.fakeHash; - patches = [ ./0001-allow-disabling-mining-pool-fetching.patch ]; - nativeBuildInputs = [ makeWrapper rsync ]; + # Apply patches only in the main build, not in the npmDeps fetcher. + postPatch = '' + patch -p1 < ${./0001-allow-disabling-mining-pool-fetching.patch} + ''; + dontNpmBuild = true; dontNpmInstall = true; @@ -141,7 +148,11 @@ in rec { pname = "mempool-frontend"; inherit version src; - sourceRoot = "source/frontend"; + # Use postUnpack (not sourceRoot) so the npmDeps fixed-output + # derivation hashes the same unpacked tree as the main build. + postUnpack = '' + cd source/frontend + ''; # Placeholder: build once, then replace with the hash from the # "hash mismatch" error output.