{ lib, config, extraInfo, ... }: let msConfig = config.services.mollysocket.settings; in with lib; { options.my.server.mollysocket.enable = mkOption { type = types.bool; default = false; description = '' Enable the mollysocket server, allowing UnifiedPush notifications for te Molly app. ''; }; config = mkIf config.my.server.mollysocket.enable { services.mollysocket = { enable = true; settings = { allowed_uuids = [ extraInfo.signal.clientUuid ]; }; }; services.nginx.virtualHosts.${extraInfo.signal.notificationServerUri} = { enableACME = true; forceSSL = true; locations."/" = { recommendedProxySettings = true; proxyPass = "http://${msConfig.host}:${builtins.toString msConfig.port}"; }; }; }; }