nixos-hypervisor/services/onlyoffice/default.nix

26 lines
726 B
Nix
Raw Normal View History

2025-01-07 13:55:31 +01:00
{ config, pkgs, lib, ... }:
let
cfg = config.services.vm_onlyoffice;
in
{
options.services.vm_onlyoffice = {
enable = lib.mkEnableOption "Enable OnlyOffice service";
2025-01-07 14:06:00 +01:00
pgsql_ip = lib.mkEnableOption "Postgres database IP address";
2025-01-07 13:55:31 +01:00
};
config = lib.mkIf cfg.enable {
services = {
onlyoffice = {
enable = true;
hostname = "office.le43.eu";
2025-01-07 14:06:00 +01:00
port = 8000;
2025-01-07 13:55:31 +01:00
postgresName = "onlyoffice";
2025-01-07 14:06:00 +01:00
postgresHost = "${cfg.pgsql_ip}";
2025-01-07 13:55:31 +01:00
postgresUser = "onlyoffice";
postgresPasswordFile = "/run/secrets/onlyoffice/office-dbpass";
jwtSecretFile = "/run/secrets/onlyoffice/office-jwtpass";
};
};
networking.firewall.allowedTCPPorts = [ 8000 ];
};
}