Restore upstream nix-bitcoin fetchNodeModules for mempool and RTL packages

Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-08-10 23:24:31 +00:00
committed by GitHub
co-authored by naturallaw777
parent 7879a2771d
commit c2dce6cf94
5 changed files with 240 additions and 153 deletions
+23 -24
View File
@@ -1,35 +1,39 @@
{ lib
, buildNpmPackage
, stdenvNoCC
, nodejs_22
, nodejs-slim_22
, fetchNodeModules
, fetchpatch
, fetchurl
, makeWrapper
}:
let
let self = stdenvNoCC.mkDerivation {
pname = "rtl";
version = "0.15.8";
src = fetchurl {
url = "https://github.com/Ride-The-Lightning/RTL/archive/refs/tags/v${version}.tar.gz";
url = "https://github.com/Ride-The-Lightning/RTL/archive/refs/tags/v${self.version}.tar.gz";
hash = "sha256-8XdGyORxB2dkZRB/Yl7zh+Quqo4L/Y0VmC6Brbr/hqU=";
};
in buildNpmPackage {
pname = "rtl";
inherit version src;
passthru = {
nodejs = nodejs_22;
nodejsRuntime = nodejs-slim_22;
# Placeholder: build once, then replace with the hash from the
# "hash mismatch" error output.
npmDepsHash = "sha256-hNBPdIBTHkAQ0Kztj9xvBEqYIkFW8mLZ3W6LAwYPOqM=";
npmFlags = [ "--legacy-peer-deps" ];
nodeModules = fetchNodeModules {
inherit (self) src nodejs;
# TODO-EXTERNAL: Remove `npmFlags` when no longer required
# See: https://github.com/Ride-The-Lightning/RTL/issues/1182
npmFlags = "--legacy-peer-deps";
hash = "sha256-oMqd6nLzS6iQ9w4z2yzpR2unA5qhOq5YdvfoS8IgYLY=";
};
};
nativeBuildInputs = [
makeWrapper
];
dontNpmBuild = true;
dontNpmInstall = true;
phases = "unpackPhase patchPhase installPhase";
# `src` already contains the precompiled frontend and backend.
# Copy all files required for packaging, like in
@@ -42,25 +46,20 @@ in buildNpmPackage {
package.json \
frontend \
backend \
node_modules \
${self.nodeModules}/lib/node_modules \
$dest
makeWrapper ${nodejs-slim_22}/bin/node "$out/bin/rtl" \
makeWrapper ${self.nodejsRuntime}/bin/node "$out/bin/rtl" \
--add-flags "$dest/rtl.js"
runHook postInstall
'';
passthru = {
nodejs = nodejs_22;
nodejsRuntime = nodejs-slim_22;
};
meta = with lib; {
description = "A web interface for LND";
description = "A web interface for LND, c-lightning and Eclair";
homepage = "https://github.com/Ride-The-Lightning/RTL";
license = licenses.mit;
maintainers = with maintainers; [ ];
maintainers = with maintainers; [ nixbitcoin erikarvstedt ];
platforms = platforms.unix;
};
}
}; in self