From d733187ec5af0d5df977cbc9c325a0fdcccad727 Mon Sep 17 00:00:00 2001 From: Sovran Systems <99053422+naturallaw777@users.noreply.github.com> Date: Mon, 10 Aug 2026 17:40:53 -0500 Subject: [PATCH] Update npm dependencies and patch handling in default.nix --- packages/mempool/default.nix | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/mempool/default.nix b/packages/mempool/default.nix index dc847ff..d35deeb 100644 --- a/packages/mempool/default.nix +++ b/packages/mempool/default.nix @@ -83,12 +83,22 @@ in rec { # postPatch runs in the npmDeps fetcher too. Copy the lock file to # the repo root so prefetch-npm-deps can find it, then apply patches # in the main build. + # Also create a dummy rust-gbt stub so `npm ci --offline` can resolve + # the `file:./rust-gbt` dependency before the real native module is + # synced in buildPhase. postPatch = '' cp backend/package-lock.json . patch -p1 < ${./0001-allow-disabling-mining-pool-fetching.patch} + mkdir -p backend/rust-gbt + cat > backend/rust-gbt/package.json <<'EOF' + {"name":"rust-gbt","version":"0.0.1","main":"index.js"} + EOF ''; - npmDepsHash = "sha256-PhLLW7IFW3B6QrqvSYIyovgNXXwZiiRwX/4JgN2rDkU="; + npmDepsHash = "sha256-tuMrdc9vw5CWzaL1xRxZnskgGwElWv8qz4LSNvSUdXI="; + npmDepsFetcherVersion = 2; + makeCacheWritable = true; + npmFlags = [ "--legacy-peer-deps" ]; nativeBuildInputs = [ makeWrapper @@ -137,9 +147,6 @@ in rec { # Argument `config` (type: attrset) defines the mempool frontend config. # If `{}`, the default config is used. - # See here for available options: - # https://github.com/mempool/mempool/blob/master/frontend/src/app/services/state.service.ts - # (`interface Env` and `defaultEnv`) mkFrontend = config: buildNpmPackage { pname = "mempool-frontend"; inherit version src; @@ -150,7 +157,8 @@ in rec { cp frontend/package-lock.json . ''; - npmDepsHash = "sha256-fCI491w1htcYarEDbDff34Ir9pxW6E1lUNSCn3Xd+FE="; + npmDepsHash = "sha256-/UwK0X9knsqTSAmnh2+jk35SK/J7DjBUhsR7e6OOn8Y="; + npmDepsFetcherVersion = 2; nativeBuildInputs = [ makeWrapper