From 24bc983363aab940ac42b1954335d3d57a63a00c Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Mon, 8 Apr 2024 06:01:47 +0000 Subject: [PATCH 1/4] clightning-plugins: remove unmaintained plugins prometheus & helpme --- README.md | 2 -- docs/services.md | 6 +++--- examples/configuration.nix | 2 +- modules/clightning-plugins/default.nix | 3 --- modules/clightning-plugins/prometheus.nix | 21 --------------------- pkgs/clightning-plugins/default.nix | 10 ---------- test/tests.nix | 2 -- 7 files changed, 4 insertions(+), 42 deletions(-) delete mode 100644 modules/clightning-plugins/prometheus.nix diff --git a/README.md b/README.md index 24b66292..d26d1828 100644 --- a/README.md +++ b/README.md @@ -74,9 +74,7 @@ NixOS modules ([src](modules/modules.nix)) Available plugins: * [clboss](https://github.com/ZmnSCPxj/clboss): automated C-Lightning Node Manager * [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 * [rebalance](https://github.com/lightningd/plugins/tree/master/rebalance): keeps your channels balanced * [summary](https://github.com/lightningd/plugins/tree/master/summary): print a nice summary of the node status * [trustedcoin](https://github.com/nbd-wtf/trustedcoin) ([experimental](docs/services.md#trustedcoin)): replaces bitcoind with trusted public explorers diff --git a/docs/services.md b/docs/services.md index a45884a5..8037905f 100644 --- a/docs/services.md +++ b/docs/services.md @@ -571,13 +571,13 @@ You can activate and configure these plugins like so: services.clightning = { enable = true; plugins = { - prometheus.enable = true; - prometheus.listen = "0.0.0.0:9900"; + clboss.enable = true; + clboss.min-onchain = 40000; }; }; ``` -Please have a look at the module for a plugin (e.g. [prometheus.nix](../modules/clightning-plugins/prometheus.nix)) to learn its configuration options. +Please have a look at the module for a plugin (e.g. [clboss.nix](../modules/clightning-plugins/clboss.nix)) to learn its configuration options. ### Trustedcoin When `services.clightning.tor.proxy` is enabled, [trustedcoin](https://github.com/nbd-wtf/trustedcoin) diff --git a/examples/configuration.nix b/examples/configuration.nix index 3cdabf47..0013bb83 100644 --- a/examples/configuration.nix +++ b/examples/configuration.nix @@ -52,7 +52,7 @@ # # == Plugins # See ../README.md (Features → clightning) for the list of available plugins. - # services.clightning.plugins.prometheus.enable = true; + # services.clightning.plugins.clboss.enable = true; # # == REST server # Set this to create a clightning REST onion service. diff --git a/modules/clightning-plugins/default.nix b/modules/clightning-plugins/default.nix index 6dd61c71..64ddcbef 100644 --- a/modules/clightning-plugins/default.nix +++ b/modules/clightning-plugins/default.nix @@ -4,7 +4,6 @@ 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)"; }; @@ -15,7 +14,6 @@ in { imports = [ ./clboss.nix ./feeadjuster.nix - ./prometheus.nix ./summary.nix ./trustedcoin.nix ./zmq.nix @@ -26,7 +24,6 @@ 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/modules/clightning-plugins/prometheus.nix b/modules/clightning-plugins/prometheus.nix deleted file mode 100644 index 94cf4c45..00000000 --- a/modules/clightning-plugins/prometheus.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ config, lib, ... }: - -with lib; -let cfg = config.services.clightning.plugins.prometheus; in -{ - options.services.clightning.plugins.prometheus = { - enable = mkEnableOption "Prometheus (clightning plugin)"; - listen = mkOption { - type = types.str; - default = "0.0.0.0:9750"; - description = "Address and port to bind to."; - }; - }; - - config = mkIf cfg.enable { - services.clightning.extraConfig = '' - plugin=${config.nix-bitcoin.pkgs.clightning-plugins.prometheus.path} - prometheus-listen=${cfg.listen} - ''; - }; -} diff --git a/pkgs/clightning-plugins/default.nix b/pkgs/clightning-plugins/default.nix index 613e2018..bbdb0bef 100644 --- a/pkgs/clightning-plugins/default.nix +++ b/pkgs/clightning-plugins/default.nix @@ -20,20 +20,10 @@ let 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.17.1" - + " --replace pyln-client~=0.9.3 pyln-client~=24.02"; - }; rebalance = { description = "Keeps your channels balanced"; }; diff --git a/test/tests.nix b/test/tests.nix index f490d492..5793b149 100644 --- a/test/tests.nix +++ b/test/tests.nix @@ -152,9 +152,7 @@ let services.clightning.plugins = { clboss.enable = true; feeadjuster.enable = true; - helpme.enable = true; monitor.enable = true; - prometheus.enable = true; rebalance.enable = true; summary.enable = true; zmq = let tcpEndpoint = "tcp://127.0.0.1:5501"; in { From b27078efa518ed823061b89a26a5c244452d400e Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Mon, 8 Apr 2024 06:05:49 +0000 Subject: [PATCH 2/4] clightning-plugins: remove unmaintained summary plugin --- README.md | 1 - modules/clightning-plugins/default.nix | 1 - modules/clightning-plugins/summary.nix | 39 -------------------------- pkgs/clightning-plugins/default.nix | 4 --- test/tests.nix | 1 - 5 files changed, 46 deletions(-) delete mode 100644 modules/clightning-plugins/summary.nix diff --git a/README.md b/README.md index d26d1828..894cbdfa 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,6 @@ NixOS modules ([src](modules/modules.nix)) * [currencyrate](https://github.com/lightningd/plugins/tree/master/currencyrate): currency converter * [monitor](https://github.com/lightningd/plugins/tree/master/monitor): helps you analyze the health of your peers and channels * [rebalance](https://github.com/lightningd/plugins/tree/master/rebalance): keeps your channels balanced - * [summary](https://github.com/lightningd/plugins/tree/master/summary): print a nice summary of the node status * [trustedcoin](https://github.com/nbd-wtf/trustedcoin) ([experimental](docs/services.md#trustedcoin)): replaces bitcoind with trusted public explorers * [zmq](https://github.com/lightningd/plugins/tree/master/zmq): publishes notifications via ZeroMQ to configured endpoints * [clightning-rest](https://github.com/Ride-The-Lightning/c-lightning-REST): REST server for clightning diff --git a/modules/clightning-plugins/default.nix b/modules/clightning-plugins/default.nix index 64ddcbef..3142008c 100644 --- a/modules/clightning-plugins/default.nix +++ b/modules/clightning-plugins/default.nix @@ -14,7 +14,6 @@ in { imports = [ ./clboss.nix ./feeadjuster.nix - ./summary.nix ./trustedcoin.nix ./zmq.nix ]; diff --git a/modules/clightning-plugins/summary.nix b/modules/clightning-plugins/summary.nix deleted file mode 100644 index 0dd1c17a..00000000 --- a/modules/clightning-plugins/summary.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ config, lib, ... }: - -with lib; -let cfg = config.services.clightning.plugins.summary; in -{ - options.services.clightning.plugins.summary = { - enable = mkEnableOption "Summary (clightning plugin)"; - currency = mkOption { - type = types.str; - default = "USD"; - description = mdDoc "The currency to look up on btcaverage."; - }; - currencyPrefix = mkOption { - type = types.str; - default = "USD $"; - description = mdDoc "The prefix to use for the currency."; - }; - availabilityInterval = mkOption { - type = types.int; - default = 300; - description = mdDoc "How often in seconds the availability should be calculated."; - }; - availabilityWindow = mkOption { - type = types.int; - default = 72; - description = mdDoc "How many hours the availability should be averaged over."; - }; - }; - - config = mkIf cfg.enable { - services.clightning.extraConfig = '' - plugin=${config.nix-bitcoin.pkgs.clightning-plugins.summary.path} - summary-currency="${cfg.currency}" - summary-currency-prefix="${cfg.currencyPrefix}" - summary-availability-interval=${toString cfg.availabilityInterval} - summary-availability-window=${toString cfg.availabilityWindow} - ''; - }; -} diff --git a/pkgs/clightning-plugins/default.nix b/pkgs/clightning-plugins/default.nix index bbdb0bef..d4ba9419 100644 --- a/pkgs/clightning-plugins/default.nix +++ b/pkgs/clightning-plugins/default.nix @@ -27,10 +27,6 @@ let 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"; diff --git a/test/tests.nix b/test/tests.nix index 5793b149..5d5d9813 100644 --- a/test/tests.nix +++ b/test/tests.nix @@ -154,7 +154,6 @@ let feeadjuster.enable = true; monitor.enable = true; rebalance.enable = true; - summary.enable = true; zmq = let tcpEndpoint = "tcp://127.0.0.1:5501"; in { enable = true; channel-opened = tcpEndpoint; From aec25c7d04fbcf37901266584ef9545b5161758a Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Mon, 8 Apr 2024 06:19:06 +0000 Subject: [PATCH 3/4] clightning-plugins: update --- pkgs/clightning-plugins/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/clightning-plugins/default.nix b/pkgs/clightning-plugins/default.nix index d4ba9419..93c77156 100644 --- a/pkgs/clightning-plugins/default.nix +++ b/pkgs/clightning-plugins/default.nix @@ -6,8 +6,8 @@ let src = pkgs.fetchFromGitHub { owner = "lightningd"; repo = "plugins"; - rev = "ce078bb74e10b5dea779fcd9fbe77e1d3e72db7a"; - hash = "sha256-SCHSJzXe1l14hVT47SU3lWDxKCKwwICjXjSDpjUX96U"; + rev = "83a80d134ecb2adc6647235d56195332e846f5cb"; + sha256 = "1vwsvrak2jkcdfcaj426z4qk8shpkqhrqlfnb9i43w24ry7sqzy1"; }; version = builtins.substring 0 7 src.rev; From 5730afe48e5f1ae9ca0a3bbd4c2c699df564f76f Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Mon, 8 Apr 2024 15:54:24 +0200 Subject: [PATCH 4/4] obsolete-options: add removed clightning plugins --- modules/obsolete-options.nix | 10 +++++++++- test/tests.nix | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/obsolete-options.nix b/modules/obsolete-options.nix index a221668b..d0f8d43b 100644 --- a/modules/obsolete-options.nix +++ b/modules/obsolete-options.nix @@ -107,7 +107,15 @@ in { (mkRemovedOptionModule [ "services" "clightning" "plugins" "clboss" "acknowledgeDeprecation" ] '' `clboss` is maintained again and has been un-deprecated. '') - ]; + ] + ++ + # 0.0.106 + (map (plugin: + mkRemovedOptionModule [ "services" "clightning" "plugins" plugin ] '' + This plugin is no longer maintained. + '') + [ "summary" "helpme" "prometheus" ] + ); config = { # Migrate old clightning-rest datadir from nix-bitcoin versions < 0.0.70 systemd.services.clightning-rest-migrate-datadir = let diff --git a/test/tests.nix b/test/tests.nix index 5d5d9813..1d39d29d 100644 --- a/test/tests.nix +++ b/test/tests.nix @@ -49,6 +49,9 @@ let removed = [ # Only defined via `obsolete-options.nix` "commando" + "helpme" + "prometheus" + "summary" ]; available = subtractLists removed (builtins.attrNames plugins); enabled = builtins.filter (plugin: plugins.${plugin}.enable) available;