1 { lib, pkgs, config, ... }:
3 roundcubemail = pkgs.callPackage ./roundcubemail.nix {
4 inherit (pkgs.webapps) roundcubemail roundcubemail-plugins roundcubemail-skins;
5 env = config.myEnv.tools.roundcubemail;
7 rainloop = pkgs.callPackage ./rainloop.nix {};
8 cfg = config.myServices.websites.tools.email;
9 pcfg = config.services.phpfpm.pools;
12 options.myServices.websites.tools.email = {
13 enable = lib.mkEnableOption "enable email website";
20 config = lib.mkIf cfg.enable {
21 services.duplyBackup.profiles.mail.excludeFile = ''
23 + ${roundcubemail.varDir}
25 secrets.keys = roundcubemail.keys;
27 services.websites.env.tools.modules =
29 ++ rainloop.apache.modules
30 ++ roundcubemail.apache.modules;
32 services.websites.env.tools.vhostConfs.mail = {
35 hosts = ["mail.immae.eu"];
36 root = "/run/current-system/webapps/_mail";
38 (rainloop.apache.vhostConf pcfg.rainloop.socket)
39 (roundcubemail.apache.vhostConf pcfg.roundcubemail.socket)
41 <Directory /run/current-system/webapps/_mail>
50 after = lib.mkAfter rainloop.phpFpm.serviceDeps;
51 wants = rainloop.phpFpm.serviceDeps;
53 phpfpm-roundcubemail = {
54 after = lib.mkAfter roundcubemail.phpFpm.serviceDeps;
55 wants = roundcubemail.phpFpm.serviceDeps;
59 services.phpfpm.pools.roundcubemail = {
62 settings = roundcubemail.phpFpm.pool;
63 phpOptions = config.services.phpfpm.phpOptions + roundcubemail.phpFpm.phpConfig;
65 services.phpfpm.pools.rainloop = {
68 settings = rainloop.phpFpm.pool;
70 system.activationScripts = {
71 roundcubemail = roundcubemail.activationScript;
72 rainloop = rainloop.activationScript;
75 services.websites.webappDirs = {
77 "${roundcubemail.apache.webappName}" = roundcubemail.webRoot;
78 "${rainloop.apache.webappName}" = rainloop.webRoot;