summaryrefslogtreecommitdiff
path: root/os/srv/monero.nix
diff options
context:
space:
mode:
Diffstat (limited to 'os/srv/monero.nix')
-rw-r--r--os/srv/monero.nix36
1 files changed, 20 insertions, 16 deletions
diff --git a/os/srv/monero.nix b/os/srv/monero.nix
index 4e74432..f00413d 100644
--- a/os/srv/monero.nix
+++ b/os/srv/monero.nix
@@ -12,7 +12,13 @@ in
{
options.os.srv.monero = {
wallet.enable = lib.mkEnableOption "enables the monero wallet";
- service.enable = lib.mkEnableOption "enables hosting a monero node";
+ service = {
+ enable = lib.mkEnableOption "enables hosting a monero node";
+ proxyConfig = lib.mkOption {
+ type = lib.types.attrs;
+ default = { };
+ };
+ };
};
config = lib.mkMerge [
@@ -22,10 +28,6 @@ in
(lib.mkIf cfg.service.enable {
assertions = [
{
- assertion = config.os.srv.nginx.enable;
- message = "Hosting a Monero node requires nginx for proxying";
- }
- {
assertion = config.os.srv.sops.enable;
message = "Required for password secure password storing";
}
@@ -55,19 +57,21 @@ in
};
};
- services.nginx.virtualHosts."xmr.${masterDomain}" = {
- enableACME = true;
- forceSSL = true;
+ os.srv.monero.service.proxyConfig = {
+ "xmr.${masterDomain}" = {
+ enableACME = true;
+ forceSSL = true;
- locations."/" = {
- proxyPass = "http://127.0.0.1:18081";
- extraConfig = ''
- proxy_read_timeout 600s;
- proxy_send_timeout 600s;
- client_max_body_size 50m;
+ locations."/" = {
+ proxyPass = "http://${config.os.core.network.ips.vm9-relays}:18081";
+ extraConfig = ''
+ proxy_read_timeout 600s;
+ proxy_send_timeout 600s;
+ client_max_body_size 50m;
- ${securityTemplates.restrictToInternal}
- '';
+ ${securityTemplates.restrictToInternal}
+ '';
+ };
};
};