2022-08-21 15:41:38 +03:00
|
|
|
{ lib
|
|
|
|
, stdenvNoCC
|
2023-07-08 16:32:58 +03:00
|
|
|
, nodejs-18_x
|
|
|
|
, nodejs-slim-18_x
|
2022-08-21 15:41:38 +03:00
|
|
|
, fetchNodeModules
|
|
|
|
, fetchurl
|
|
|
|
, makeWrapper
|
|
|
|
, rsync
|
|
|
|
}:
|
|
|
|
let self = stdenvNoCC.mkDerivation {
|
|
|
|
pname = "clightning-rest";
|
2023-10-08 21:41:33 +03:00
|
|
|
version = "0.10.7";
|
2022-08-21 15:41:38 +03:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/Ride-The-Lightning/c-lightning-REST/archive/refs/tags/v${self.version}.tar.gz";
|
2023-10-08 21:41:33 +03:00
|
|
|
hash = "sha256-m/djMQk+g994GaTW/yysD/eVgWcqY8cap41tot0UElI=";
|
2022-08-21 15:41:38 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
passthru = {
|
2023-07-08 16:32:58 +03:00
|
|
|
nodejs = nodejs-18_x;
|
|
|
|
nodejsRuntime = nodejs-slim-18_x;
|
2022-08-21 15:41:38 +03:00
|
|
|
|
|
|
|
nodeModules = fetchNodeModules {
|
|
|
|
inherit (self) src nodejs;
|
2023-10-08 21:41:33 +03:00
|
|
|
hash = "sha256-Dz4/kR4X34idfuPFFQJYE8yGIR3OSseDnkAhqbZ6iEI=";
|
2022-08-21 15:41:38 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-12-14 21:51:22 +03:00
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
2022-08-21 15:41:38 +03:00
|
|
|
phases = "unpackPhase patchPhase installPhase";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
dest=$out/lib/node_modules/clightning-rest
|
|
|
|
mkdir -p $dest
|
|
|
|
${rsync}/bin/rsync -a --inplace * ${self.nodeModules}/lib/node_modules \
|
|
|
|
--exclude=/{screenshots,'*.Dockerfile'} \
|
|
|
|
$dest
|
|
|
|
|
2022-08-25 22:00:00 +03:00
|
|
|
makeWrapper ${self.nodejsRuntime}/bin/node "$out/bin/cl-rest" \
|
|
|
|
--add-flags "$dest/cl-rest.js"
|
2022-08-21 15:41:38 +03:00
|
|
|
|
|
|
|
runHook postInstall
|
2021-12-14 21:51:22 +03:00
|
|
|
'';
|
2021-12-14 21:51:23 +03:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "REST API for C-Lightning";
|
|
|
|
homepage = "https://github.com/Ride-The-Lightning/c-lightning-REST";
|
|
|
|
license = licenses.mit;
|
2022-12-18 15:13:46 +03:00
|
|
|
maintainers = with maintainers; [ nixbitcoin erikarvstedt ];
|
2021-12-14 21:51:23 +03:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2022-08-21 15:41:38 +03:00
|
|
|
}; in self
|