]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/websites/tools/mail/default.nix
Remove duply-backup
[perso/Immae/Config/Nix.git] / modules / private / websites / tools / mail / default.nix
index 218c3a56d3290321700f929b1ef444794e5bad05..390f7adb98dd37fcd11f23ededa22ee028b515f7 100644 (file)
@@ -1,11 +1,15 @@
-{ lib, pkgs, config, myconfig,  ... }:
+{ lib, pkgs, config,  ... }:
 let
   roundcubemail = pkgs.callPackage ./roundcubemail.nix {
-    inherit (pkgs.webapps) roundcubemail roundcubemail-plugins roundcubemail-skins;
-    env = myconfig.env.tools.roundcubemail;
+    inherit (pkgs.webapps) roundcubemail;
+    env = config.myEnv.tools.roundcubemail;
+    inherit config;
+  };
+  rainloop = pkgs.callPackage ./rainloop.nix {
+    rainloop = pkgs.rainloop-community;
   };
-  rainloop = pkgs.callPackage ./rainloop.nix {};
   cfg = config.myServices.websites.tools.email;
+  pcfg = config.services.phpfpm.pools;
 in
 {
   options.myServices.websites.tools.email = {
@@ -17,10 +21,6 @@ in
   ];
 
   config = lib.mkIf cfg.enable {
-    services.duplyBackup.profiles.mail.excludeFile = ''
-      + ${rainloop.varDir}
-      + ${roundcubemail.varDir}
-      '';
     secrets.keys = roundcubemail.keys;
 
     services.websites.env.tools.modules =
@@ -32,12 +32,12 @@ in
       certName   = "mail";
       addToCerts = true;
       hosts      = ["mail.immae.eu"];
-      root       = "/run/current-system/webapps/_mail";
+      root       = ./www;
       extraConfig = [
-        rainloop.apache.vhostConf
-        roundcubemail.apache.vhostConf
+        (rainloop.apache.vhostConf pcfg.rainloop.socket)
+        (roundcubemail.apache.vhostConf pcfg.roundcubemail.socket)
         ''
-          <Directory /run/current-system/webapps/_mail>
+          <Directory ${./www}>
             Require all granted
             Options -Indexes
           </Directory>
@@ -56,24 +56,24 @@ in
     };
 
     services.phpfpm.pools.roundcubemail = {
-      listen = roundcubemail.phpFpm.socket;
-      extraConfig = roundcubemail.phpFpm.pool;
-      phpOptions = config.services.phpfpm.phpOptions + roundcubemail.phpFpm.phpConfig;
+      user = "wwwrun";
+      group = "wwwrun";
+      settings = roundcubemail.phpFpm.pool;
+      phpOptions = config.services.phpfpm.phpOptions + ''
+        date.timezone = 'CET'
+      '';
+      phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [ all.imagick ]);
     };
-    services.phpfpm.poolConfigs = {
-      rainloop = rainloop.phpFpm.pool;
+    services.phpfpm.pools.rainloop = {
+      user = "wwwrun";
+      group = "wwwrun";
+      settings = rainloop.phpFpm.pool;
+      phpPackage = pkgs.php72;
     };
     system.activationScripts = {
       roundcubemail = roundcubemail.activationScript;
       rainloop = rainloop.activationScript;
     };
-
-    myServices.websites.webappDirs = {
-      _mail = ./www;
-      "${roundcubemail.apache.webappName}" = roundcubemail.webRoot;
-      "${rainloop.apache.webappName}" = rainloop.webRoot;
-    };
-
   };
 
 }