Merge branch 'electrum-server' of https://github.com/nixbitcoin/nix-bitcoin into nixbitcoin-electrum-server
This commit is contained in:
commit
7eed67278d
5 changed files with 52 additions and 15 deletions
|
|
@ -9,6 +9,8 @@ let
|
|||
${optionalString cfg.testnet "testnet=1"}
|
||||
${optionalString (cfg.dbCache != null) "dbcache=${toString cfg.dbCache}"}
|
||||
${optionalString (cfg.prune != null) "prune=${toString cfg.prune}"}
|
||||
${optionalString (cfg.sysperms != null) "sysperms=${if cfg.sysperms then "1" else "0"}"}
|
||||
${optionalString (cfg.disablewallet != null) "disablewallet=${if cfg.disablewallet then "1" else "0"}"}
|
||||
|
||||
# Connection options
|
||||
${optionalString (cfg.port != null) "port=${toString cfg.port}"}
|
||||
|
|
@ -151,6 +153,20 @@ in {
|
|||
If enabled, the bitcoin service will listen.
|
||||
'';
|
||||
};
|
||||
sysperms = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)
|
||||
'';
|
||||
};
|
||||
disablewallet = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Do not load the wallet and disable wallet RPC calls
|
||||
'';
|
||||
};
|
||||
dbCache = mkOption {
|
||||
type = types.nullOr (types.ints.between 4 16384);
|
||||
default = null;
|
||||
|
|
@ -195,6 +211,7 @@ in {
|
|||
chmod o-rw '${cfg.dataDir}/bitcoin.conf'
|
||||
chown '${cfg.user}:${cfg.group}' '${cfg.dataDir}/bitcoin.conf'
|
||||
echo "rpcpassword=$(cat /secrets/bitcoin-rpcpassword)" >> '${cfg.dataDir}/bitcoin.conf'
|
||||
chmod -R g+rX '${cfg.dataDir}/blocks'
|
||||
'';
|
||||
postStart = ''
|
||||
until '${cfg.package}'/bin/bitcoin-cli -datadir='${cfg.dataDir}' getnetworkinfo; do sleep 1; done
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue