Fixed typo and replaced tab with spaces

This commit is contained in:
nixbitcoin 2019-01-04 10:47:06 +01:00
parent 9ada1d32f3
commit 197155fb0b
No known key found for this signature in database
GPG Key ID: DD11F9AD5308B3BA

View File

@ -33,19 +33,19 @@ in {
systemd.services.electrs = { systemd.services.electrs = {
description = "Run electrs"; description = "Run electrs";
wantedBy = [ "muli-user.target" ]; wantedBy = [ "multi-user.target" ];
requires = [ "bitcoind.service" ]; requires = [ "bitcoind.service" ];
after = [ "bitcoind.service" ]; after = [ "bitcoind.service" ];
# create shell script to start up electrs safely with password parameter # create shell script to start up electrs safely with password parameter
preStart = '' preStart = ''
mkdir -m 0770 -p ${cfg.dataDir} mkdir -m 0770 -p ${cfg.dataDir}
chown 'electrs:electrs' ${cfg.dataDir} chown 'electrs:electrs' ${cfg.dataDir}
echo "${pkgs.electrs}/bin/electrs -vvv --timestamp --db-dir ${cfg.dataDir} --daemon-dir /var/lib/bitcoind --cookie=${config.services.bitcoind.rpcuser}:$(cat /secrets/bitcoin-rpcpassword)" > /var/lib/electrs/startscript.sh echo "${pkgs.electrs}/bin/electrs -vvv --timestamp --db-dir ${cfg.dataDir} --daemon-dir /var/lib/bitcoind --cookie=${config.services.bitcoind.rpcuser}:$(cat /secrets/bitcoin-rpcpassword)" > /var/lib/electrs/startscript.sh
chown -R 'electrs:electrs' ${cfg.dataDir} chown -R 'electrs:electrs' ${cfg.dataDir}
chmod u+x ${cfg.dataDir}/startscript.sh chmod u+x ${cfg.dataDir}/startscript.sh
''; '';
serviceConfig = { serviceConfig = {
PermissionsStartOnly = "true"; PermissionsStartOnly = "true";
ExecStart = "${pkgs.bash}/bin/bash ${cfg.dataDir}/startscript.sh"; ExecStart = "${pkgs.bash}/bin/bash ${cfg.dataDir}/startscript.sh";
User = "electrs"; User = "electrs";
Restart = "on-failure"; Restart = "on-failure";