2022-08-21 12:41:37 +00:00
|
|
|
{ lib
|
|
|
|
, stdenvNoCC
|
2023-07-08 13:32:58 +00:00
|
|
|
, nodejs-18_x
|
|
|
|
, nodejs-slim-18_x
|
2022-08-21 12:41:37 +00:00
|
|
|
, fetchNodeModules
|
|
|
|
, fetchpatch
|
|
|
|
, fetchurl
|
|
|
|
, applyPatches
|
|
|
|
, makeWrapper
|
|
|
|
}:
|
|
|
|
let self = stdenvNoCC.mkDerivation {
|
|
|
|
pname = "rtl";
|
2023-10-08 18:19:27 +00:00
|
|
|
version = "0.14.1";
|
2022-08-21 12:41:37 +00:00
|
|
|
|
2022-12-20 22:23:24 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/Ride-The-Lightning/RTL/archive/refs/tags/v${self.version}.tar.gz";
|
2023-10-08 18:19:27 +00:00
|
|
|
hash = "sha256-sbV7d/imdCXglpAS3hh7fETvSxMzegi63AfbS1imqbk=";
|
2022-08-21 12:41:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
passthru = {
|
2023-07-08 13:32:58 +00:00
|
|
|
nodejs = nodejs-18_x;
|
|
|
|
nodejsRuntime = nodejs-slim-18_x;
|
2022-08-21 12:41:37 +00:00
|
|
|
|
|
|
|
nodeModules = fetchNodeModules {
|
|
|
|
inherit (self) src nodejs;
|
2023-01-26 18:23:09 +00:00
|
|
|
# TODO-EXTERNAL: Remove `npmFlags` when no longer required
|
|
|
|
# See: https://github.com/Ride-The-Lightning/RTL/issues/1182
|
|
|
|
npmFlags = "--legacy-peer-deps";
|
2023-10-08 18:19:27 +00:00
|
|
|
hash = "sha256-0fu14j4OvsYGBhu/p67EUFmuHCbIPlLVm4e8qd9tk3o=";
|
2022-08-21 12:41:37 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-12-14 18:51:22 +00:00
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
2022-08-21 12:41:37 +00:00
|
|
|
phases = "unpackPhase patchPhase installPhase";
|
|
|
|
|
|
|
|
# `src` already contains the precompiled frontend and backend.
|
|
|
|
# Copy all files required for packaging, like in
|
|
|
|
# https://github.com/Ride-The-Lightning/RTL/blob/master/dockerfiles/Dockerfile
|
|
|
|
installPhase = ''
|
|
|
|
dest=$out/lib/node_modules/rtl
|
|
|
|
mkdir -p $dest
|
|
|
|
cp -r \
|
|
|
|
rtl.js \
|
|
|
|
package.json \
|
|
|
|
frontend \
|
|
|
|
backend \
|
|
|
|
${self.nodeModules}/lib/node_modules \
|
|
|
|
$dest
|
|
|
|
|
2022-08-25 19:00:00 +00:00
|
|
|
makeWrapper ${self.nodejsRuntime}/bin/node "$out/bin/rtl" \
|
|
|
|
--add-flags "$dest/rtl.js"
|
2022-08-21 12:41:37 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2021-12-14 18:51:22 +00:00
|
|
|
'';
|
2021-12-14 18:51:23 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A web interface for LND, c-lightning and Eclair";
|
|
|
|
homepage = "https://github.com/Ride-The-Lightning/RTL";
|
|
|
|
license = licenses.mit;
|
2022-12-18 12:13:46 +00:00
|
|
|
maintainers = with maintainers; [ nixbitcoin erikarvstedt ];
|
2021-12-14 18:51:23 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2022-08-21 12:41:37 +00:00
|
|
|
}; in self
|