Make bitcoin rpcuser and pass configurable
This commit is contained in:
parent
668d66085a
commit
83eabcf952
2 changed files with 17 additions and 3 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue