2019-11-27 13:04:31 +00:00
|
|
|
{ pkgs }: with pkgs;
|
|
|
|
|
2020-06-22 12:10:54 +00:00
|
|
|
let
|
2020-08-27 10:17:40 +00:00
|
|
|
rpcauthSrc = builtins.fetchurl {
|
|
|
|
url = "https://raw.githubusercontent.com/bitcoin/bitcoin/d6cde007db9d3e6ee93bd98a9bbfdce9bfa9b15b/share/rpcauth/rpcauth.py";
|
|
|
|
sha256 = "189mpplam6yzizssrgiyv70c9899ggh8cac76j4n7v0xqzfip07n";
|
|
|
|
};
|
|
|
|
rpcauth = pkgs.writeScriptBin "rpcauth" ''
|
2020-09-24 14:32:38 +00:00
|
|
|
exec ${pkgs.python3}/bin/python ${rpcauthSrc} "$@"
|
2020-08-27 10:17:40 +00:00
|
|
|
'';
|
2020-06-22 12:10:54 +00:00
|
|
|
in
|
2020-10-23 08:45:49 +00:00
|
|
|
writers.writeBash "generate-secrets" ''
|
2020-12-16 00:28:12 +00:00
|
|
|
export PATH=${lib.makeBinPath [ coreutils pwgen openssl gnugrep rpcauth ]}
|
2019-11-27 13:04:31 +00:00
|
|
|
. ${./generate-secrets.sh} ${./openssl.cnf}
|
|
|
|
''
|