2022-08-27 04:15:06 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let cfg = config.services.clightning.plugins.trustedcoin; in
|
|
|
|
{
|
|
|
|
options.services.clightning.plugins.trustedcoin = {
|
|
|
|
enable = mkEnableOption "Trustedcoin (clightning plugin)";
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = config.nix-bitcoin.pkgs.trustedcoin;
|
|
|
|
defaultText = "config.nix-bitcoin.pkgs.trustedcoin";
|
2023-03-03 20:00:00 +00:00
|
|
|
description = mdDoc "The package providing trustedcoin binaries.";
|
2022-08-27 04:15:06 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2023-08-02 22:05:03 +00:00
|
|
|
services.clightning = {
|
|
|
|
useBcliPlugin = false;
|
|
|
|
extraConfig = ''
|
|
|
|
plugin=${cfg.package}/bin/trustedcoin
|
|
|
|
'';
|
|
|
|
};
|
2023-04-13 19:00:00 +00:00
|
|
|
|
|
|
|
# Trustedcoin does not honor the clightning's proxy configuration.
|
|
|
|
# Ref.: https://github.com/nbd-wtf/trustedcoin/pull/19
|
|
|
|
systemd.services.clightning.environment = mkIf (config.services.clightning.proxy != null) {
|
|
|
|
HTTPS_PROXY = "socks5://${config.services.clightning.proxy}";
|
|
|
|
};
|
2022-08-27 04:15:06 +00:00
|
|
|
};
|
|
|
|
}
|