clightning: add option useBcliPlugin
This decouples modules `clightning` and `trustedcoin`. `clightning` no longer depends on `trustedcoin`, which restores the acyclic dependency graph described in `modules.nix`
This commit is contained in:
parent
f3e9c644e3
commit
31b76f1ffe
2 changed files with 22 additions and 5 deletions
|
|
@ -14,10 +14,12 @@ let cfg = config.services.clightning.plugins.trustedcoin; in
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.clightning.extraConfig = ''
|
||||
plugin=${cfg.package}/bin/trustedcoin
|
||||
disable-plugin=bcli
|
||||
'';
|
||||
services.clightning = {
|
||||
useBcliPlugin = false;
|
||||
extraConfig = ''
|
||||
plugin=${cfg.package}/bin/trustedcoin
|
||||
'';
|
||||
};
|
||||
|
||||
# Trustedcoin does not honor the clightning's proxy configuration.
|
||||
# Ref.: https://github.com/nbd-wtf/trustedcoin/pull/19
|
||||
|
|
|
|||
|
|
@ -49,6 +49,15 @@ let
|
|||
parameters, as fully qualified data source name.
|
||||
'';
|
||||
};
|
||||
useBcliPlugin = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Use bitcoind (via plugin `bcli`) for getting block data.
|
||||
This option is disabled by plugins that use other sources for
|
||||
fetching block data, like `trustedcoin`.
|
||||
'';
|
||||
};
|
||||
extraConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
|
|
@ -107,7 +116,13 @@ let
|
|||
network = bitcoind.makeNetworkName "bitcoin" "regtest";
|
||||
configFile = pkgs.writeText "config" ''
|
||||
network=${network}
|
||||
${optionalString (!cfg.plugins.trustedcoin.enable) "bitcoin-datadir=${bitcoind.dataDir}"}
|
||||
${
|
||||
if cfg.useBcliPlugin then ''
|
||||
bitcoin-datadir=${config.services.bitcoind.dataDir}
|
||||
'' else ''
|
||||
disable-plugin=bcli
|
||||
''
|
||||
}
|
||||
${optionalString (cfg.proxy != null) "proxy=${cfg.proxy}"}
|
||||
always-use-proxy=${boolToString cfg.always-use-proxy}
|
||||
bind-addr=${cfg.address}:${toString cfg.port}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue