NixServerConfig/module/roundcube.nix
2025-12-24 20:17:53 +01:00

35 lines
997 B
Nix

{ config, pkgs, lib, ... }:
{
age.secrets = {
YfDrVBDJcVoYNZeJ = {
file = ../secrets/cache/YfDrVBDJcVoYNZeJ;
owner = "roundcube";
};
LtnxWKwZdDIxAKzp = {
file = ../secrets/cache/LtnxWKwZdDIxAKzp;
owner = "roundcube";
};
};
services.roundcube = {
enable = true;
hostName = "${config.module.roundcube.subdomain}.${config.module.domain}";
plugins = [ "multiple_accounts" ];
configureNginx = false;
extraConfig = ''
// Concatenate the protocol string with the file contents in PHP
$config['default_host'] = 'ssl://' . trim(file_get_contents('${config.age.secrets.LtnxWKwZdDIxAKzp.path}'));
$config['default_port'] = 993;
$config['smtp_server'] = 'tls://' . trim(file_get_contents('${config.age.secrets.YfDrVBDJcVoYNZeJ.path}'));
$config['smtp_port'] = 465;
$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
'';
};
users.groups.roundcube.members = [ "nginx" "phpfpm" ];
}