nixos-config/modules/server/mollysocket.nix

41 lines
844 B
Nix
Raw Normal View History

2024-09-01 09:12:53 +02:00
{
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}";
};
};
};
}