2020-12-21 11:19:15 +00: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 = ''
|
|
|
|
Specify target amount (in satoshi) that CLBOSS will leave onchain.
|
|
|
|
'';
|
|
|
|
};
|
2021-04-11 12:40:37 +00:00
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = config.nix-bitcoin.pkgs.clboss;
|
|
|
|
description = "The package providing clboss binaries.";
|
|
|
|
};
|
2020-12-21 11:19:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
services.clightning.extraConfig = ''
|
2021-04-11 12:40:37 +00:00
|
|
|
plugin=${cfg.package}/bin/clboss
|
2020-12-21 11:19:15 +00:00
|
|
|
clboss-min-onchain=${toString cfg.min-onchain}
|
|
|
|
'';
|
|
|
|
systemd.services.clightning.path = [
|
|
|
|
pkgs.dnsutils
|
|
|
|
] ++ optional config.services.clightning.enforceTor (hiPrio config.nix-bitcoin.torify);
|
|
|
|
};
|
|
|
|
}
|