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

29 lines
774 B
Nix
Raw Normal View History

2020-11-18 18:01:45 -08:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.clightning.plugins;
pluginPkgs = config.nix-bitcoin.pkgs.clightning-plugins;
in {
imports = [
2020-12-21 03:19:15 -08:00
./clboss.nix
2020-11-18 18:01:45 -08:00
./prometheus.nix
./summary.nix
./zmq.nix
];
options.services.clightning.plugins = {
helpme.enable = mkEnableOption "Help me (clightning plugin)";
monitor.enable = mkEnableOption "Monitor (clightning plugin)";
rebalance.enable = mkEnableOption "Rebalance (clightning plugin)";
};
config = {
services.clightning.extraConfig = mkMerge [
(mkIf cfg.helpme.enable "plugin=${pluginPkgs.helpme.path}")
(mkIf cfg.monitor.enable "plugin=${pluginPkgs.monitor.path}")
(mkIf cfg.rebalance.enable "plugin=${pluginPkgs.rebalance.path}")
];
};
}