1 { lib, pkgs, config, ... }:
3 roundcubemail = pkgs.callPackage ./roundcubemail.nix {
4 inherit (pkgs.webapps) roundcubemail;
5 env = config.myEnv.tools.roundcubemail;
8 rainloop = pkgs.callPackage ./rainloop.nix {
9 rainloop = pkgs.rainloop-community;
11 cfg = config.myServices.websites.tools.email;
12 pcfg = config.services.phpfpm.pools;
15 options.myServices.websites.tools.email = {
16 enable = lib.mkEnableOption "enable email website";
23 config = lib.mkIf cfg.enable {
24 secrets.keys = roundcubemail.keys;
26 services.websites.env.tools.modules =
28 ++ rainloop.apache.modules
29 ++ roundcubemail.apache.modules;
31 services.websites.env.tools.vhostConfs.mail = {
34 hosts = ["mail.immae.eu"];
37 (rainloop.apache.vhostConf pcfg.rainloop.socket)
38 (roundcubemail.apache.vhostConf pcfg.roundcubemail.socket)
49 after = lib.mkAfter rainloop.phpFpm.serviceDeps;
50 wants = rainloop.phpFpm.serviceDeps;
52 phpfpm-roundcubemail = {
53 after = lib.mkAfter roundcubemail.phpFpm.serviceDeps;
54 wants = roundcubemail.phpFpm.serviceDeps;
58 services.phpfpm.pools.roundcubemail = {
61 settings = roundcubemail.phpFpm.pool;
62 phpOptions = config.services.phpfpm.phpOptions + ''
65 phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [ all.imagick ]);
67 services.phpfpm.pools.rainloop = {
70 settings = rainloop.phpFpm.pool;
71 phpPackage = pkgs.php72;
73 system.activationScripts = {
74 roundcubemail = roundcubemail.activationScript;
75 rainloop = rainloop.activationScript;