nixos-config/modules/roundcube.nix

57 lines
1.3 KiB
Nix
Raw Normal View History

2025-02-09 14:40:12 -05:00
{
config,
lib,
pkgs,
...
}:
2025-02-08 01:30:04 -05:00
let
cfg = config.my.roundcube;
fpm = config.services.phpfpm.pools.roundcube;
roundcube = config.services.roundcube;
in
{
options.my.roundcube = {
enable = lib.mkEnableOption "roundcube webmail";
};
config = lib.mkIf cfg.enable {
services.roundcube = {
enable = true;
configureNginx = false;
2025-02-09 14:40:12 -05:00
package = pkgs.roundcube.withPlugins (
p: with p; [
persistent_login
contextmenu
custom_from
thunderbird_labels
]
);
2025-02-08 01:30:04 -05:00
plugins = [
"persistent_login"
"contextmenu"
"custom_from"
"thunderbird_labels"
];
dicts = with pkgs.aspellDicts; [ en ];
extraConfig = ''
$config['imap_host'] = "ssl://imap.migadu.com:993";
$config['smtp_host'] = "ssl://smtp.migadu.com:465";
$config['smtp_user'] = "%u";
$config['smtp_pass'] = "%p";
'';
};
services.phpfpm.pools.roundcube.settings = lib.mapAttrs (name: lib.mkForce) {
"listen.owner" = "caddy";
"listen.group" = "caddy";
};
services.caddy.virtualHosts."mail.cy7.sh".extraConfig = ''
import common
root ${roundcube.package}
php_fastcgi unix/${fpm.socket}
2025-02-08 12:23:32 -05:00
file_server
2025-02-08 01:30:04 -05:00
'';
};
}