mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-24 08:39:42 -04:00
63 lines
1.2 KiB
Nix
63 lines
1.2 KiB
Nix
{ pkgs, lib, config, ... }:
|
|
|
|
with lib;
|
|
let
|
|
cfg = config.modules.system.bitcoin;
|
|
|
|
in
|
|
{ options.modules.system.bitcoin = { enable = mkEnableOption "system.bitcoin"; };
|
|
|
|
imports = [ ./modules ];
|
|
|
|
config = mkIf cfg.enable {
|
|
programs.bash.shellAliases = {
|
|
btc = "bitcoin-cli";
|
|
};
|
|
|
|
users = {
|
|
users = {
|
|
"bitcoind" = {
|
|
description = "bitcoind system user";
|
|
isSystemUser = true;
|
|
group = "bitcoin";
|
|
home = /var/lib/bitcoind;
|
|
createHome = true;
|
|
};
|
|
};
|
|
groups = {
|
|
"bitcoin" = {
|
|
members = [ "clightning" "electrs" ];
|
|
};
|
|
};
|
|
};
|
|
|
|
services.bitcoind = {
|
|
"bitcoind" = {
|
|
enable = true;
|
|
testnet = false;
|
|
user = "bitcoind";
|
|
group = "bitcoin";
|
|
configFile = /var/lib/bitcoind/bitcoin.conf;
|
|
|
|
rpc = {
|
|
port = 8332;
|
|
};
|
|
|
|
extraConfig = ''
|
|
server=1
|
|
mempoolfullrbf=1
|
|
v2transport=1
|
|
|
|
rpcbind=127.0.0.1
|
|
rpcallowip=127.0.0.1
|
|
|
|
proxy=127.0.0.1:9050
|
|
listen=1
|
|
listenonion=1
|
|
torcontrol=127.0.0.1:9051
|
|
torenablecircuit=1
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|