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:
@@ -14,10 +14,12 @@ let cfg = config.services.clightning.plugins.trustedcoin; in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
services.clightning.extraConfig = ''
|
services.clightning = {
|
||||||
plugin=${cfg.package}/bin/trustedcoin
|
useBcliPlugin = false;
|
||||||
disable-plugin=bcli
|
extraConfig = ''
|
||||||
'';
|
plugin=${cfg.package}/bin/trustedcoin
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
# Trustedcoin does not honor the clightning's proxy configuration.
|
# Trustedcoin does not honor the clightning's proxy configuration.
|
||||||
# Ref.: https://github.com/nbd-wtf/trustedcoin/pull/19
|
# Ref.: https://github.com/nbd-wtf/trustedcoin/pull/19
|
||||||
|
|||||||
+16
-1
@@ -49,6 +49,15 @@ let
|
|||||||
parameters, as fully qualified data source name.
|
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 {
|
extraConfig = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = "";
|
default = "";
|
||||||
@@ -107,7 +116,13 @@ let
|
|||||||
network = bitcoind.makeNetworkName "bitcoin" "regtest";
|
network = bitcoind.makeNetworkName "bitcoin" "regtest";
|
||||||
configFile = pkgs.writeText "config" ''
|
configFile = pkgs.writeText "config" ''
|
||||||
network=${network}
|
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}"}
|
${optionalString (cfg.proxy != null) "proxy=${cfg.proxy}"}
|
||||||
always-use-proxy=${boolToString cfg.always-use-proxy}
|
always-use-proxy=${boolToString cfg.always-use-proxy}
|
||||||
bind-addr=${cfg.address}:${toString cfg.port}
|
bind-addr=${cfg.address}:${toString cfg.port}
|
||||||
|
|||||||
Reference in New Issue
Block a user