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
3 changed files with 30 additions and 1 deletions

View File

@@ -17,6 +17,14 @@ in {
default = "/var/lib/electrs";
description = "The data directory for electrs.";
};
# Needed until electrs tls proxy is removed
host = mkOption {
type = types.str;
default = "localhost";
description = ''
The host on which incoming connections arrive.
'';
};
user = mkOption {
type = types.str;
default = "electrs";
@@ -44,6 +52,13 @@ in {
default = 50001;
description = "RPC port.";
};
daemonrpc = mkOption {
type = types.str;
default = "127.0.0.1:8332";
description = ''
Bitcoin daemon JSONRPC 'addr:port' to connect
'';
};
extraArgs = mkOption {
type = types.separatedString " ";
default = "";
@@ -97,7 +112,8 @@ in {
"--jsonrpc-import --index-batch-size=10"
} \
--db-dir '${cfg.dataDir}' --daemon-dir '${config.services.bitcoind.dataDir}' \
--electrum-rpc-addr=${toString cfg.address}:${toString cfg.port} ${cfg.extraArgs}
--electrum-rpc-addr=${toString cfg.address}:${toString cfg.port} \
--daemon-rpc-addr=${toString cfg.daemonrpc} ${cfg.extraArgs}
'';
User = cfg.user;
Group = cfg.group;