nix-bitcoin/network-vbox.nix

49 lines
1.4 KiB
Nix
Raw Normal View History

2018-11-28 14:58:36 -08:00
let
secrets = import ./secrets/secrets.nix;
2018-12-03 14:16:01 -08:00
bitcoin-rpcpassword = {
text = secrets.bitcoinrpcpassword;
destDir = "/secrets/";
user = "bitcoin";
group = "bitcoinrpc";
permissions = "0440";
};
lightning-charge-api-token = {
text = "API_TOKEN=" + secrets.lightning-charge-api-token;
destDir = "/secrets/";
user = "clightning";
group = "clightning";
permissions = "0440";
};
# variable is called CHARGE_TOKEN instead of API_TOKEN
lightning-charge-api-token-for-nanopos = {
text = "CHARGE_TOKEN=" + secrets.lightning-charge-api-token;
destDir = "/secrets/";
user = "nanopos";
group = "nanopos";
permissions = "0440";
};
2018-12-03 14:33:21 -08:00
liquid-rpcpassword = {
text = secrets.liquidrpcpassword;
destDir = "/secrets/";
user = "liquid";
group = "liquid";
permissions = "0440";
};
2018-11-28 14:58:36 -08:00
in
2018-11-13 15:44:54 -08:00
{
bitcoin-node =
{ config, pkgs, ... }:
2018-12-03 14:16:01 -08:00
{
deployment.targetEnv = "virtualbox";
2018-12-06 02:45:45 -08:00
deployment.virtualbox.memorySize = 4096; # megabytes
2018-11-13 15:44:54 -08:00
deployment.virtualbox.vcpu = 2; # number of cpus
deployment.virtualbox.headless = true;
2018-11-28 14:58:36 -08:00
2018-12-03 14:16:01 -08:00
deployment.keys = {
inherit bitcoin-rpcpassword lightning-charge-api-token;
2018-12-03 14:33:21 -08:00
}
// (if (config.services.nanopos.enable) then { inherit lightning-charge-api-token-for-nanopos; } else { })
// (if (config.services.liquidd.enable) then { inherit liquid-rpcpassword; } else { });
2018-11-13 15:44:54 -08:00
};
}