diff options
Diffstat (limited to 'modules/private/websites/tools/mail/default.nix')
-rw-r--r-- | modules/private/websites/tools/mail/default.nix | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/modules/private/websites/tools/mail/default.nix b/modules/private/websites/tools/mail/default.nix deleted file mode 100644 index 390f7ad..0000000 --- a/modules/private/websites/tools/mail/default.nix +++ /dev/null | |||
@@ -1,79 +0,0 @@ | |||
1 | { lib, pkgs, config, ... }: | ||
2 | let | ||
3 | roundcubemail = pkgs.callPackage ./roundcubemail.nix { | ||
4 | inherit (pkgs.webapps) roundcubemail; | ||
5 | env = config.myEnv.tools.roundcubemail; | ||
6 | inherit config; | ||
7 | }; | ||
8 | rainloop = pkgs.callPackage ./rainloop.nix { | ||
9 | rainloop = pkgs.rainloop-community; | ||
10 | }; | ||
11 | cfg = config.myServices.websites.tools.email; | ||
12 | pcfg = config.services.phpfpm.pools; | ||
13 | in | ||
14 | { | ||
15 | options.myServices.websites.tools.email = { | ||
16 | enable = lib.mkEnableOption "enable email website"; | ||
17 | }; | ||
18 | |||
19 | imports = [ | ||
20 | ./mta-sts.nix | ||
21 | ]; | ||
22 | |||
23 | config = lib.mkIf cfg.enable { | ||
24 | secrets.keys = roundcubemail.keys; | ||
25 | |||
26 | services.websites.env.tools.modules = | ||
27 | [ "proxy_fcgi" ] | ||
28 | ++ rainloop.apache.modules | ||
29 | ++ roundcubemail.apache.modules; | ||
30 | |||
31 | services.websites.env.tools.vhostConfs.mail = { | ||
32 | certName = "mail"; | ||
33 | addToCerts = true; | ||
34 | hosts = ["mail.immae.eu"]; | ||
35 | root = ./www; | ||
36 | extraConfig = [ | ||
37 | (rainloop.apache.vhostConf pcfg.rainloop.socket) | ||
38 | (roundcubemail.apache.vhostConf pcfg.roundcubemail.socket) | ||
39 | '' | ||
40 | <Directory ${./www}> | ||
41 | Require all granted | ||
42 | Options -Indexes | ||
43 | </Directory> | ||
44 | '' | ||
45 | ]; | ||
46 | }; | ||
47 | systemd.services = { | ||
48 | phpfpm-rainloop = { | ||
49 | after = lib.mkAfter rainloop.phpFpm.serviceDeps; | ||
50 | wants = rainloop.phpFpm.serviceDeps; | ||
51 | }; | ||
52 | phpfpm-roundcubemail = { | ||
53 | after = lib.mkAfter roundcubemail.phpFpm.serviceDeps; | ||
54 | wants = roundcubemail.phpFpm.serviceDeps; | ||
55 | }; | ||
56 | }; | ||
57 | |||
58 | services.phpfpm.pools.roundcubemail = { | ||
59 | user = "wwwrun"; | ||
60 | group = "wwwrun"; | ||
61 | settings = roundcubemail.phpFpm.pool; | ||
62 | phpOptions = config.services.phpfpm.phpOptions + '' | ||
63 | date.timezone = 'CET' | ||
64 | ''; | ||
65 | phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [ all.imagick ]); | ||
66 | }; | ||
67 | services.phpfpm.pools.rainloop = { | ||
68 | user = "wwwrun"; | ||
69 | group = "wwwrun"; | ||
70 | settings = rainloop.phpFpm.pool; | ||
71 | phpPackage = pkgs.php72; | ||
72 | }; | ||
73 | system.activationScripts = { | ||
74 | roundcubemail = roundcubemail.activationScript; | ||
75 | rainloop = rainloop.activationScript; | ||
76 | }; | ||
77 | }; | ||
78 | |||
79 | } | ||