nixos-hypervisor/services/onlyoffice/default.nix

39 lines
1 KiB
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:58 +01:00
pgsql_ip = lib.mkOption {
type = lib.types.str;
description = "The PostgreSQL host IP address";
};
2025-01-07 13:55:31 +01:00
};
config = lib.mkIf cfg.enable {
2025-01-08 09:21:06 +01:00
age.secrets = {
office-dbpass = {
file = ./secrets/office-dbpass.age;
owner = "onlyoffice";
};
office-jwtpass = {
file = ./secrets/office-jwtpass.age;
owner = "onlyoffice";
};
};
2025-01-07 13:55:31 +01:00
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";
2025-01-08 09:21:06 +01:00
postgresPasswordFile = config.age.secrets.office-dbpass.path;
jwtSecretFile = config.age.secrets.office-jwtpass.path;
2025-01-07 13:55:31 +01:00
};
};
2025-01-08 09:21:06 +01:00
networking.firewall.allowedTCPPorts = [ 80 4369 5432 5672 6379 8000 8080 ];
2025-01-07 13:55:31 +01:00
};
}