nix-bitcoin/pkgs/clightning-plugins/default.nix
Jonas Nick 875fac6862
update nixpkgs
btcpayserver: 1.6.12 -> 1.7.1
bitcoind: 24.0 -> 24.0.1
clightning: 0.12.1 -> 22.11.1
lnd: 0.15.4-beta -> 0.15.5-beta
nbxplorer: 2.3.41 -> 2.3.49
2022-12-14 14:48:54 +00:00

91 lines
2.7 KiB
Nix

pkgs: nbPython3Packages:
let
inherit (pkgs) lib;
src = pkgs.fetchFromGitHub {
owner = "lightningd";
repo = "plugins";
rev = "e625369423b00c70b23641662f62ccd898286edc";
sha256 = "04f30xlfr7pgdmdgka87x7sc9j82wc4zv7fbiqrjsc83dkmly81i";
};
version = builtins.substring 0 7 src.rev;
plugins = with nbPython3Packages; {
currencyrate = {
description = "Currency rate fetcher and converter";
extraPkgs = [ requests cachetools ];
};
feeadjuster = {
description = "Dynamically changes channel fees to keep your channels more balanced";
};
helpme = {
description = "Walks you through setting up a c-lightning node, offering advice for common problems";
};
monitor = {
description = "Helps you analyze the health of your peers and channels";
extraPkgs = [ packaging ];
};
prometheus = {
description = "Lightning node exporter for the prometheus timeseries server";
extraPkgs = [ prometheus_client ];
patchRequirements =
"--replace prometheus-client==0.6.0 prometheus-client==0.13.1"
+ " --replace pyln-client~=0.9.3 pyln-client~=22.11rc1";
};
rebalance = {
description = "Keeps your channels balanced";
};
summary = {
description = "Prints a summary of the node status";
extraPkgs = [ packaging requests ];
};
zmq = {
description = "Publishes notifications via ZeroMQ to configured endpoints";
scriptName = "cl-zmq";
extraPkgs = [ twisted txzmq ];
};
};
basePkgs = [ nbPython3Packages.pyln-client ];
mkPlugin = name: plugin: let
python = pkgs.python3.withPackages (_: basePkgs ++ (plugin.extraPkgs or []));
script = "${plugin.scriptName or name}.py";
drv = pkgs.stdenv.mkDerivation {
pname = "clightning-plugin-${name}";
inherit version;
buildInputs = [ python ];
buildCommand = ''
cp --no-preserve=mode -r '${src}/${name}' "$out"
cd "$out"
${lib.optionalString (plugin ? patchRequirements) ''
substituteInPlace requirements.txt ${plugin.patchRequirements}
''}
# Check that requirements are met
PYTHONPATH='${toString python}/${python.sitePackages}' \
${pkgs.python3Packages.pip}/bin/pip install -r requirements.txt --no-cache --no-index
chmod +x '${script}'
patchShebangs '${script}'
'';
passthru.path = "${drv}/${script}";
meta = with lib; {
inherit (plugin) description;
homepage = "https://github.com/lightningd/plugins";
license = licenses.bsd3;
maintainers = with maintainers; [ nixbitcoin earvstedt ];
platforms = platforms.unix;
};
};
in drv;
in
builtins.mapAttrs mkPlugin plugins