63 lines
1.2 KiB
Nix
63 lines
1.2 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
{
|
|
services = {
|
|
bitcoind.mainnet = {
|
|
enable = true;
|
|
prune = 0;
|
|
testnet = false;
|
|
dataDir = "/var/lib/bitcoind";
|
|
extraConfig = ''
|
|
bind=127.0.0.1
|
|
bind=[::1]
|
|
listen=1
|
|
listenonion=1
|
|
onlynet=onion
|
|
proxy=127.0.0.1:9050
|
|
proxyrandomize=1
|
|
torcontrol=127.0.0.1:9051
|
|
|
|
discover=0
|
|
|
|
txindex=1
|
|
disablewallet=0
|
|
|
|
maxconnections=60
|
|
maxuploadtarget=20480
|
|
dbcache=8192
|
|
bantime=86400
|
|
|
|
whitelist=download@127.0.0.1
|
|
|
|
rpccookiefile=/var/lib/bitcoind/.cookie
|
|
rpccookieperms=group
|
|
rpcbind=127.0.0.1
|
|
rpcbind=10.88.0.1
|
|
rpcallowip=127.0.0.1
|
|
rpcallowip=10.88.0.0/16
|
|
'';
|
|
};
|
|
|
|
tor = {
|
|
enable = true;
|
|
client.enable = true;
|
|
|
|
settings = {
|
|
ControlPort = 9051;
|
|
CookieAuthentication = true;
|
|
CookieAuthFile = "/run/tor/control.authcookie";
|
|
CookieAuthFileGroupReadable = true;
|
|
};
|
|
};
|
|
};
|
|
|
|
systemd.services.tor.serviceConfig.Group = "tor";
|
|
|
|
systemd.tmpfiles.rules = [
|
|
"d /var/lib/tor 0750 tor tor - -"
|
|
];
|
|
|
|
users.groups.tor = { };
|
|
|
|
users.users.bitcoind-mainnet.extraGroups = [ "tor" ];
|
|
}
|