From f08b83bce2d3ee71de3a68bc3335f0e7c075af6b Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Mon, 25 Apr 2022 11:19:10 +0200 Subject: [PATCH] clboss: update module --- modules/clightning-plugins/clboss.nix | 31 ++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/modules/clightning-plugins/clboss.nix b/modules/clightning-plugins/clboss.nix index 970a9cc..3a439b2 100644 --- a/modules/clightning-plugins/clboss.nix +++ b/modules/clightning-plugins/clboss.nix @@ -4,7 +4,14 @@ with lib; let cfg = config.services.clightning.plugins.clboss; in { options.services.clightning.plugins.clboss = { - enable = mkEnableOption "CLBOSS (clightning plugin)"; + enable = mkOption { + type = types.bool; + default = true; + description = '' + Whether to enable CLBOSS (clightning plugin). + See also: https://github.com/ZmnSCPxj/clboss#operating + ''; + }; min-onchain = mkOption { type = types.ints.positive; default = 30000; @@ -14,6 +21,25 @@ let cfg = config.services.clightning.plugins.clboss; in the funds in your clightning wallet. ''; }; + min-channel = mkOption { + type = types.ints.positive; + default = 500000; + description = "The minimum size (in satoshi) of channels created by CLBOSS."; + }; + max-channel = mkOption { + type = types.ints.positive; + default = 16777215; + description = "The maximum size (in satoshi) of channels created by CLBOSS."; + }; + zerobasefee = mkOption { + type = types.enum [ "require" "allow" "disallow" ]; + default = "allow"; + description = '' + require: set `base_fee` to 0. + allow: set `base_fee` according to the CLBOSS heuristics, which may include value 0. + disallow: set `base_fee` to according to the CLBOSS heuristics, with a minimum value of 1. + ''; + }; package = mkOption { type = types.package; default = config.nix-bitcoin.pkgs.clboss; @@ -26,6 +52,9 @@ let cfg = config.services.clightning.plugins.clboss; in services.clightning.extraConfig = '' plugin=${cfg.package}/bin/clboss clboss-min-onchain=${toString cfg.min-onchain} + clboss-min-channel=${toString cfg.min-channel} + clboss-max-channel=${toString cfg.max-channel} + clboss-zerobasefee=${cfg.zerobasefee} ''; systemd.services.clightning.path = [ pkgs.dnsutils