nix-bitcoin/modules/clightning-plugins/clboss.nix

35 lines
1.1 KiB
Nix
Raw Normal View History

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 = ''
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
'';
};
package = mkOption {
type = types.package;
default = config.nix-bitcoin.pkgs.clboss;
defaultText = "config.nix-bitcoin.pkgs.clboss";
description = "The package providing clboss binaries.";
};
2020-12-21 03:19:15 -08:00
};
config = mkIf cfg.enable {
services.clightning.extraConfig = ''
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
] ++ optional config.services.clightning.tor.proxy (hiPrio config.nix-bitcoin.torify);
2020-12-21 03:19:15 -08:00
};
}