nixos-hypervisor/services/onlyoffice/default.nix
2025-01-07 14:06:58 +01:00

28 lines
779 B
Nix

{ config, pkgs, lib, ... }:
let
cfg = config.services.vm_onlyoffice;
in
{
options.services.vm_onlyoffice = {
enable = lib.mkEnableOption "Enable OnlyOffice service";
pgsql_ip = lib.mkOption {
type = lib.types.str;
description = "The PostgreSQL host IP address";
};
};
config = lib.mkIf cfg.enable {
services = {
onlyoffice = {
enable = true;
hostname = "office.le43.eu";
port = 8000;
postgresName = "onlyoffice";
postgresHost = "${cfg.pgsql_ip}";
postgresUser = "onlyoffice";
postgresPasswordFile = "/run/secrets/onlyoffice/office-dbpass";
jwtSecretFile = "/run/secrets/onlyoffice/office-jwtpass";
};
};
networking.firewall.allowedTCPPorts = [ 8000 ];
};
}