2020-12-21 03:19:15 -08:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let cfg = config.services.clightning.plugins.clboss; in
|
|
|
|
{
|
|
|
|
options.services.clightning.plugins.clboss = {
|
|
|
|
enable = mkEnableOption "CLBOSS (clightning plugin)";
|
|
|
|
min-onchain = mkOption {
|
|
|
|
type = types.ints.positive;
|
|
|
|
default = 30000;
|
|
|
|
description = ''
|
2021-11-26 06:13:29 -08:00
|
|
|
Target amount (in satoshi) that CLBOSS will leave on-chain.
|
|
|
|
clboss will only open new channels if this amount is smaller than
|
|
|
|
the funds in your clightning wallet.
|
2020-12-21 03:19:15 -08:00
|
|
|
'';
|
|
|
|
};
|
2021-04-11 05:40:37 -07:00
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = config.nix-bitcoin.pkgs.clboss;
|
2021-12-07 19:07:28 -08:00
|
|
|
defaultText = "config.nix-bitcoin.pkgs.clboss";
|
2021-04-11 05:40:37 -07:00
|
|
|
description = "The package providing clboss binaries.";
|
|
|
|
};
|
2020-12-21 03:19:15 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
services.clightning.extraConfig = ''
|
2021-04-11 05:40:37 -07:00
|
|
|
plugin=${cfg.package}/bin/clboss
|
2020-12-21 03:19:15 -08:00
|
|
|
clboss-min-onchain=${toString cfg.min-onchain}
|
|
|
|
'';
|
|
|
|
systemd.services.clightning.path = [
|
|
|
|
pkgs.dnsutils
|
2021-11-28 12:24:49 -08:00
|
|
|
] ++ optional config.services.clightning.tor.proxy (hiPrio config.nix-bitcoin.torify);
|
2020-12-21 03:19:15 -08:00
|
|
|
};
|
|
|
|
}
|