From e3c54aa64e8167b7baf4fd89511d74ba8157c921 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Mon, 25 Jul 2022 17:08:01 -0700 Subject: [PATCH] clightning: add currencyrate plugin Add the currencyrate plugin. This is used by other plugins to fetch currency rates. This can be used for setting fiat amounts in bolt12 invoices. Signed-off-by: William Casarin --- README.md | 1 + modules/clightning-plugins/default.nix | 2 ++ pkgs/clightning-plugins/default.nix | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 07b70fe..75f911f 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,7 @@ NixOS modules ([src](modules/modules.nix)) Available plugins: * [clboss](https://github.com/ZmnSCPxj/clboss): automated C-Lightning Node Manager * [commando](https://github.com/lightningd/plugins/tree/master/commando): control your node over lightning + * [currencyrate](https://github.com/lightningd/plugins/tree/master/currencyrate): currency converter * [helpme](https://github.com/lightningd/plugins/tree/master/helpme): walks you through setting up a fresh c-lightning node * [monitor](https://github.com/lightningd/plugins/tree/master/monitor): helps you analyze the health of your peers and channels * [prometheus](https://github.com/lightningd/plugins/tree/master/prometheus): lightning node exporter for the prometheus timeseries server diff --git a/modules/clightning-plugins/default.nix b/modules/clightning-plugins/default.nix index 36f2937..b31352a 100644 --- a/modules/clightning-plugins/default.nix +++ b/modules/clightning-plugins/default.nix @@ -3,6 +3,7 @@ with lib; let options.services.clightning.plugins = { + currencyrate.enable = mkEnableOption "Currencyrate (clightning plugin)"; helpme.enable = mkEnableOption "Help me (clightning plugin)"; monitor.enable = mkEnableOption "Monitor (clightning plugin)"; rebalance.enable = mkEnableOption "Rebalance (clightning plugin)"; @@ -24,6 +25,7 @@ in { config = { services.clightning.extraConfig = mkMerge [ + (mkIf cfg.currencyrate.enable "plugin=${pluginPkgs.currencyrate.path}") (mkIf cfg.helpme.enable "plugin=${pluginPkgs.helpme.path}") (mkIf cfg.monitor.enable "plugin=${pluginPkgs.monitor.path}") (mkIf cfg.rebalance.enable "plugin=${pluginPkgs.rebalance.path}") diff --git a/pkgs/clightning-plugins/default.nix b/pkgs/clightning-plugins/default.nix index 3013f9a..c7c41e0 100644 --- a/pkgs/clightning-plugins/default.nix +++ b/pkgs/clightning-plugins/default.nix @@ -17,6 +17,10 @@ let description = "Enable RPC over lightning"; extraPkgs = [ nbPython3Packages.runes ]; }; + currencyrate = { + description = "Currency rate fetcher and converter"; + extraPkgs = [ requests cachetools ]; + }; feeadjuster = { description = "Dynamically changes channel fees to keep your channels more balanced"; };