Initial commit

This commit is contained in:
Tobias Ostner 2026-04-11 11:38:46 +02:00
commit f5345d8f6a
10 changed files with 619 additions and 0 deletions

63
modules/bitcoin.nix Normal file
View file

@ -0,0 +1,63 @@
{ 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" ];
}