secure-node: only mkHiddenServices if services are enabled

This commit is contained in:
nixbitcoin 2020-07-09 11:08:39 +00:00
parent c542b92e55
commit 25adce29e5
No known key found for this signature in database
GPG Key ID: DD11F9AD5308B3BA

View File

@ -84,14 +84,14 @@ in {
enforceTor = true; enforceTor = true;
always-use-proxy = true; always-use-proxy = true;
}; };
services.tor.hiddenServices.clightning = mkHiddenService { port = cfg.clightning.onionport; toHost = (builtins.head (builtins.split ":" cfg.clightning.bind-addr)); }; services.tor.hiddenServices.clightning = mkIf cfg.clightning.enable (mkHiddenService { port = cfg.clightning.onionport; toHost = (builtins.head (builtins.split ":" cfg.clightning.bind-addr)); });
# lnd # lnd
services.lnd = { services.lnd = {
tor-socks = cfg.tor.client.socksListenAddress; tor-socks = cfg.tor.client.socksListenAddress;
enforceTor = true; enforceTor = true;
}; };
services.tor.hiddenServices.lnd = mkHiddenService { port = cfg.lnd.onionport; toHost = cfg.lnd.listen; }; services.tor.hiddenServices.lnd = mkIf cfg.lnd.enable (mkHiddenService { port = cfg.lnd.onionport; toHost = cfg.lnd.listen; });
# liquidd # liquidd
services.liquidd = { services.liquidd = {
@ -107,7 +107,7 @@ in {
enforceTor = true; enforceTor = true;
port = 7042; port = 7042;
}; };
services.tor.hiddenServices.liquidd = mkHiddenService { port = cfg.liquidd.port; toHost = cfg.liquidd.bind; }; services.tor.hiddenServices.liquidd = mkIf cfg.liquidd.enable (mkHiddenService { port = cfg.liquidd.port; toHost = cfg.liquidd.bind; });
# electrs # electrs
services.electrs = { services.electrs = {
@ -116,11 +116,11 @@ in {
TLSProxy.enable = true; TLSProxy.enable = true;
TLSProxy.port = 50003; TLSProxy.port = 50003;
}; };
services.tor.hiddenServices.electrs = mkHiddenService { services.tor.hiddenServices.electrs = mkIf cfg.electrs.enable (mkHiddenService {
port = cfg.electrs.onionport; port = cfg.electrs.onionport;
toPort = if cfg.electrs.TLSProxy.enable then cfg.electrs.TLSProxy.port else cfg.electrs.port; toPort = if cfg.electrs.TLSProxy.enable then cfg.electrs.TLSProxy.port else cfg.electrs.port;
toHost = cfg.electrs.host; toHost = cfg.electrs.host;
}; });
services.spark-wallet = { services.spark-wallet = {
onion-service = true; onion-service = true;