mirror of
https://github.com/fort-nix/nix-bitcoin.git
synced 2024-11-22 22:33:46 +03:00
Make bitcoin rpcuser and pass configurable
This commit is contained in:
parent
668d66085a
commit
83eabcf952
@ -7,14 +7,14 @@ let
|
||||
home = "/var/lib/bitcoin";
|
||||
configFile = pkgs.writeText "bitcoin.conf" ''
|
||||
listen=${if cfg.listen then "1" else "0"}
|
||||
prune=1001
|
||||
prune=2000
|
||||
assumevalid=0000000000000000000726d186d6298b5054b9a5c49639752294b322a305d240
|
||||
${optionalString (cfg.proxy != null) "proxy=${cfg.proxy}"}
|
||||
addnode=ecoc5q34tmbq54wl.onion
|
||||
discover=0
|
||||
${optionalString (cfg.port != null) "port=${toString cfg.port}"}
|
||||
rpcuser=foo
|
||||
rpcpassword=bar
|
||||
${optionalString (cfg.rpcuser != null) "rpcuser=${cfg.rpcuser}"}
|
||||
${optionalString (cfg.rpcpassword != null) "rpcuser=${cfg.rpcpassword}"}
|
||||
'';
|
||||
in {
|
||||
options.services.bitcoin = {
|
||||
@ -44,6 +44,16 @@ in {
|
||||
default = null;
|
||||
description = "Override the default port on which to listen for connections.";
|
||||
};
|
||||
rpcuser = mkOption {
|
||||
type = types.nullOr types.string;
|
||||
default = null;
|
||||
description = "Set bitcoin RPC user";
|
||||
};
|
||||
rpcpassword = mkOption {
|
||||
type = types.nullOr types.string;
|
||||
default = null;
|
||||
description = "Set bitcoin RPC password";
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
users.users.bitcoin = {
|
||||
|
@ -38,9 +38,13 @@ in {
|
||||
services.bitcoin.listen = true;
|
||||
services.bitcoin.proxy = config.services.tor.client.socksListenAddress;
|
||||
services.bitcoin.port = 8333;
|
||||
services.bitcoin.rpcuser = "bitcoinrpc";
|
||||
services.bitcoin.rpcpassword = "bitcoinrpc";
|
||||
|
||||
# clightning
|
||||
services.clightning.enable = true;
|
||||
services.clightning.bitcoin-rpcuser = config.services.bitcoin.rpcuser;
|
||||
services.clightning.bitcoin-rpcpassword = config.services.bitcoin.rpcpassword;
|
||||
|
||||
# nodeinfo
|
||||
systemd.services.nodeinfo = {
|
||||
|
Loading…
Reference in New Issue
Block a user