electrs: add netns

- Adds electrs to netns-isolation.services
- Adds daemonrpc option and specifies address option to allow using
  electrs with network namespaces
- Adds host option (defaults to localhost) as target of hidden service
This commit is contained in:
nixbitcoin 2020-05-29 11:13:50 +00:00
parent c0b02ac93a
commit d6296acaba
No known key found for this signature in database
GPG key ID: DD11F9AD5308B3BA
3 changed files with 30 additions and 1 deletions

View file

@ -100,6 +100,11 @@ in {
id = 15;
connections = [ "bitcoind" ];
};
electrs = {
id = 16;
connections = [ "bitcoind" ]
++ ( optionals config.services.electrs.TLSProxy.enable [ "nginx" ]);
};
};
systemd.services = {
@ -240,6 +245,13 @@ in {
'';
};
# electrs: Custom netns configs
services.electrs = mkIf config.services.electrs.enable {
host = if config.services.electrs.TLSProxy.enable then netns.nginx.address else netns.electrs.address;
address = netns.electrs.address;
daemonrpc = "${netns.bitcoind.address}:${toString config.services.bitcoind.rpc.port}";
};
})
# Custom netns config option values if netns-isolation not enabled
(mkIf (!cfg.enable) {