Reworked for simplified flake
This commit is contained in:
parent
f55936312f
commit
d3eddb7445
7 changed files with 234 additions and 96 deletions
34
modules/bitcoind/default.nix
Normal file
34
modules/bitcoind/default.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ config, specialConfig, lib, pkgs, ... }:
|
||||
{
|
||||
#################################
|
||||
# Bitcoin Core (bitcoind)
|
||||
#################################
|
||||
services.bitcoind = {
|
||||
enable = true;
|
||||
address = "0.0.0.0";
|
||||
port = 23002;
|
||||
listen = true;
|
||||
listenWhitelisted = true;
|
||||
whitelistedPort = 8335;
|
||||
# dataDir = "/var/lib/bitcoind";
|
||||
rpc = {
|
||||
address = "0.0.0.0";
|
||||
port = 8332;
|
||||
threads = 4;
|
||||
allowip = [
|
||||
"0.0.0.0"
|
||||
];
|
||||
};
|
||||
regtest = false;
|
||||
# network = "regtest"; # or "mainnet"
|
||||
dataDirReadableByGroup = false;
|
||||
disablewallet = null;
|
||||
dbCache = 4000;
|
||||
prune = 10000;
|
||||
txindex = true;
|
||||
zmqpubrawblock = "tcp://0.0.0.0:28332";
|
||||
zmqpubrawtx = "tcp://0.0.0.0:28333";
|
||||
user = "bitcoind";
|
||||
group = "bitcoind";
|
||||
};
|
||||
}
|
||||
18
modules/btcpay/default.nix
Normal file
18
modules/btcpay/default.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{ config, specialConfig, lib, pkgs, ... }:
|
||||
{
|
||||
|
||||
nix-bitcoin.generateSecrets = true;
|
||||
# nix-bitcoin.secretsDir = "/var/lib/secrets";
|
||||
services.btcpayserver = {
|
||||
enable = true;
|
||||
address = "0.0.0.0";
|
||||
port = 23002;
|
||||
# dataDir = "/var/lib/btcpayserver";
|
||||
lbtc = true;
|
||||
user = "btcpayserver";
|
||||
group = "btcpayserver";
|
||||
# If needed, direct BTCPay to same PostgreSQL:
|
||||
# explorerpostgres = "User ID=nbxplorer;Host=localhost;Port=5432;Database=nbxplorermainnet;";
|
||||
# Set environment variables as needed for additional DB, etc.
|
||||
};
|
||||
}
|
||||
15
modules/nbxplorer/default.nix
Normal file
15
modules/nbxplorer/default.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ config, specialConfig, lib, pkgs, ... }:
|
||||
{
|
||||
services.nbxplorer = {
|
||||
enable = true;
|
||||
address = "0.0.0.0";
|
||||
port = 24444;
|
||||
# dataDir = "/var/lib/nbxplorer";
|
||||
user = "nbxplorer";
|
||||
group = "nbxplorer";
|
||||
# Database connection string to external/local PostgreSQL:
|
||||
# postgres = "User ID=nbxplorer;Host=0.0.0.0;Port=5432;Database=nbxplorermainnet;";
|
||||
# chains = [ "btc" "ltc" "lbtc" ];
|
||||
# Additional NBXplorer server args/overrides can go here.
|
||||
};
|
||||
}
|
||||
19
modules/postgresql/default.nix
Normal file
19
modules/postgresql/default.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{ config, lib, pkgs, specialConfig, ... }:
|
||||
{
|
||||
# Disable local postgres (so NixOS won't start or manage it)
|
||||
services = {
|
||||
postgresql = {
|
||||
enable = true;
|
||||
ensureDatabases = [ "nbxplorermainnet" "btcpaydb" ];
|
||||
ensureUsers = [
|
||||
{ name = "nbxplorer"; ensureDBOwnership = true; }
|
||||
{ name = "btcpay"; ensureDBOwnership = true; }
|
||||
];
|
||||
authentication = ''
|
||||
local all all trust
|
||||
host all all 0.0.0.1/32 trust
|
||||
host all all ::1/128 trust
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue