{config, ...}: let ports = import ../data/ports.nix {}; piped_config = config.services.piped; in { config.services.piped = { enable = true; frontendDomain = "piped-fi.owo.monster"; backendDomain = "backend.piped-fi.owo.monster"; proxyDomain = "proxy.piped-fi.owo.monster"; disableRegistrations = false; postgresDBName = "piped"; postgresDBUsername = "piped"; postgresDBPassword = "piped"; postgresDBHost = "127.0.0.1"; postgresDBPort = 26257; databaseDialect = "org.hibernate.dialect.CockroachDialect"; disablePostgresDB = true; nginxForceSSL = false; nginxEnableACME = false; # Do not set proxyNginxExtraConfig here as needs be set in outside of container internalBackendPort = ports.piped-backend; internalProxyPort = ports.piped-proxy; }; config.systemd.tmpfiles.rules = [ "d /var/sockets - nginx nginx" ]; config.systemd.services.nginx.serviceConfig.ReadWritePaths = [ "/var/sockets" ]; config.services.nginx.virtualHosts."${piped_config.frontendDomain}" = { extraConfig = "listen unix:/var/sockets/piped-frontend.sock;"; listen = [ { addr = "127.0.0.1"; port = 9080; } ]; }; config.services.nginx.virtualHosts."${piped_config.backendDomain}" = { extraConfig = "listen unix:/var/sockets/piped-backend.sock;"; listen = [ { addr = "127.0.0.1"; port = 9080; } ]; }; config.services.nginx.virtualHosts."${piped_config.proxyDomain}" = { extraConfig = "listen unix:/var/sockets/piped-proxy.sock;"; listen = [ { addr = "127.0.0.1"; port = 9080; } ]; }; }