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;
11 options.myServices.websites.tools.email = {
12 enable = lib.mkEnableOption "enable email website";
19 config = lib.mkIf cfg.enable {
20 services.duplyBackup.profiles.mail.excludeFile = ''
22 + ${roundcubemail.varDir}
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"];
35 root = "/run/current-system/webapps/_mail";
37 rainloop.apache.vhostConf
38 roundcubemail.apache.vhostConf
40 <Directory /run/current-system/webapps/_mail>
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 = {
59 listen = roundcubemail.phpFpm.socket;
60 extraConfig = roundcubemail.phpFpm.pool;
61 phpOptions = config.services.phpfpm.phpOptions + roundcubemail.phpFpm.phpConfig;
63 services.phpfpm.poolConfigs = {
64 rainloop = rainloop.phpFpm.pool;
66 system.activationScripts = {
67 roundcubemail = roundcubemail.activationScript;
68 rainloop = rainloop.activationScript;
71 myServices.websites.webappDirs = {
73 "${roundcubemail.apache.webappName}" = roundcubemail.webRoot;
74 "${rainloop.apache.webappName}" = rainloop.webRoot;