electrs: add option 'extraArgs'

Electrs allows defining settings multiple times via cmdline args, but
not via config files.
So 'extraArgs' is the only way to implement overridable settings,
'extraOptions' wouldn't work.
This commit is contained in:
Erik Arvstedt 2020-03-04 18:09:03 +01:00
parent e731d71232
commit c4cf323873
No known key found for this signature in database
GPG Key ID: 33312B944DD97846

View File

@ -49,6 +49,11 @@ in {
default = 50002; default = 50002;
description = "Port on which to listen for tor client connections."; description = "Port on which to listen for tor client connections.";
}; };
extraArgs = mkOption {
type = types.separatedString " ";
default = "";
description = "Extra command line arguments passed to electrs.";
};
TLSProxy = { TLSProxy = {
enable = mkEnableOption "Nginx TLS proxy"; enable = mkEnableOption "Nginx TLS proxy";
port = mkOption { port = mkOption {
@ -81,7 +86,7 @@ in {
${pkgs.nix-bitcoin.electrs}/bin/electrs -vvv \ ${pkgs.nix-bitcoin.electrs}/bin/electrs -vvv \
${optionalString (!cfg.high-memory) "--jsonrpc-import --index-batch-size=10"} \ ${optionalString (!cfg.high-memory) "--jsonrpc-import --index-batch-size=10"} \
--db-dir '${cfg.dataDir}' --daemon-dir '${config.services.bitcoind.dataDir}' \ --db-dir '${cfg.dataDir}' --daemon-dir '${config.services.bitcoind.dataDir}' \
--electrum-rpc-addr=${toString cfg.address}:${toString cfg.port} --electrum-rpc-addr=${toString cfg.address}:${toString cfg.port} ${cfg.extraArgs}
''; '';
User = cfg.user; User = cfg.user;
Group = cfg.group; Group = cfg.group;