add presets/bitcoind-remote.nix
This simplifies integrating a remote bitcoind instance and makes `bitcoin-cli` work with the remote node. Add note regarding `whitelistedPort` to docs.
This commit is contained in:
parent
5915a34891
commit
6b539627ee
2 changed files with 44 additions and 2 deletions
25
modules/presets/bitcoind-remote.nix
Normal file
25
modules/presets/bitcoind-remote.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.services.bitcoind;
|
||||
secretsDir = config.nix-bitcoin.secretsDir;
|
||||
in {
|
||||
services.bitcoind = {
|
||||
# Make the local bitcoin-cli work with the remote node
|
||||
extraConfig = ''
|
||||
rpcuser=${cfg.rpc.users.privileged.name}
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.services.bitcoind = {
|
||||
preStart = lib.mkAfter ''
|
||||
echo "rpcpassword=$(cat ${secretsDir}/bitcoin-rpcpassword-privileged)" >> '${cfg.dataDir}'/bitcoin.conf
|
||||
'';
|
||||
postStart = lib.mkForce "";
|
||||
serviceConfig = {
|
||||
Type = lib.mkForce "oneshot";
|
||||
ExecStart = lib.mkForce "${pkgs.coreutils}/bin/true";
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue