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

34 lines
971 B
Nix
Raw Normal View History

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