nixos-hypervisor/services/onlyoffice/default.nix
Théo Barnouin 781ce2d5e9
All checks were successful
/ Build Nix targets (push) Successful in 3m36s
Format using alejandra
2025-01-23 14:13:19 +01:00

41 lines
1 KiB
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 {
age.secrets = {
office-dbpass = {
file = ./secrets/office-dbpass.age;
owner = "onlyoffice";
};
office-jwtpass = {
file = ./secrets/office-jwtpass.age;
owner = "onlyoffice";
};
};
services = {
onlyoffice = {
enable = true;
hostname = "office.le43.eu";
port = 8000;
postgresName = "onlyoffice";
postgresHost = "${cfg.pgsql_ip}";
postgresUser = "onlyoffice";
postgresPasswordFile = config.age.secrets.office-dbpass.path;
jwtSecretFile = config.age.secrets.office-jwtpass.path;
};
};
networking.firewall.allowedTCPPorts = [80 4369 5432 5672 6379 8000 8080];
};
}