- coturn: switch static-auth-secret to static-auth-secret-file - matrix: switch registration_token and turn_secret to file-based - murmur: switch password to environmentFile with agenix - p2pool: move public wallet address to service-configs.nix
46 lines
1.2 KiB
Nix
46 lines
1.2 KiB
Nix
{
|
|
config,
|
|
service_configs,
|
|
lib,
|
|
...
|
|
}:
|
|
{
|
|
imports = [
|
|
(lib.serviceMountWithZpool "p2pool" service_configs.zpool_ssds [
|
|
service_configs.p2pool.dataDir
|
|
])
|
|
(lib.serviceFilePerms "p2pool" [
|
|
"Z ${service_configs.p2pool.dataDir} 0700 p2pool p2pool"
|
|
])
|
|
];
|
|
|
|
services.p2pool = {
|
|
enable = true;
|
|
dataDir = service_configs.p2pool.dataDir;
|
|
walletAddress = service_configs.p2pool.walletAddress;
|
|
sidechain = "nano";
|
|
host = "127.0.0.1";
|
|
rpcPort = service_configs.ports.public.monero_rpc.port;
|
|
zmqPort = service_configs.ports.private.monero_zmq.port;
|
|
extraArgs = [
|
|
" --stratum 0.0.0.0:${builtins.toString service_configs.ports.private.p2pool_stratum.port}"
|
|
];
|
|
};
|
|
|
|
# Ensure p2pool starts after monero is ready
|
|
systemd.services.p2pool = {
|
|
after = [ "monero.service" ];
|
|
wants = [ "monero.service" ];
|
|
};
|
|
|
|
# Stop p2pool on UPS battery to conserve power
|
|
services.apcupsd.hooks = lib.mkIf config.services.apcupsd.enable {
|
|
onbattery = "systemctl stop p2pool";
|
|
offbattery = "systemctl start p2pool";
|
|
};
|
|
|
|
networking.firewall.allowedTCPPorts = [
|
|
service_configs.ports.public.p2pool_p2p.port
|
|
];
|
|
}
|