42 lines
876 B
Nix
42 lines
876 B
Nix
{
|
|
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;
|
|
proxyWebsockets = true;
|
|
proxyPass = "http://${msConfig.host}:${builtins.toString msConfig.port}";
|
|
};
|
|
};
|
|
};
|
|
}
|