]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - virtual/modules/websites/chloe.nix
Move goaccess to specific module
[perso/Immae/Config/Nix.git] / virtual / modules / websites / chloe.nix
index 2c0c65ddb611c9ac15fdeb296a3fc6f2641224f6..3309dd2b6dc2204346842eed3d29d70a87648d14 100644 (file)
@@ -1,5 +1,9 @@
 { lib, pkgs, config, mylibs, ... }:
 let
+    chloe = pkgs.callPackage ../../packages/chloe.nix { inherit (mylibs) checkEnv fetchedGitPrivate; };
+    chloe_dev = chloe { environment = "dev"; };
+    chloe_prod = chloe { environment = "prod"; };
+
     cfg = config.services.myWebsites.Chloe;
 in {
   options.services.myWebsites.Chloe = {
@@ -13,15 +17,42 @@ in {
 
   config = lib.mkMerge [
     (lib.mkIf cfg.production.enable {
+      services.myWebsites.commons.stats.enable = true;
+      services.myWebsites.commons.stats.sites = [
+        {
+          name = "osteopathe-cc.fr";
+          conf = ../../packages/chloe_goaccess.conf;
+        }
+      ];
+
       security.acme.certs."chloe" = config.services.myCertificates.certConfig // {
         domain = "osteopathe-cc.fr";
         extraDomains = {
           "www.osteopathe-cc.fr" = null;
         };
       };
+
+      services.phpfpm.poolConfigs.chloe_prod = chloe_prod.phpFpm.pool;
+      system.activationScripts.chloe_prod = chloe_prod.activationScript;
+      services.myWebsites.production.modules = chloe_prod.apache.modules;
+      services.myWebsites.production.vhostConfs.chloe = {
+        certName    = "chloe";
+        hosts       = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ];
+        root        = chloe_prod.webRoot;
+        extraConfig = [ chloe_prod.apache.vhostConf ];
+      };
     })
     (lib.mkIf cfg.integration.enable {
       security.acme.certs."eldiron".extraDomains."chloe.immae.eu" = null;
+      services.phpfpm.poolConfigs.chloe_dev = chloe_dev.phpFpm.pool;
+      system.activationScripts.chloe_dev = chloe_dev.activationScript;
+      services.myWebsites.integration.modules = chloe_dev.apache.modules;
+      services.myWebsites.integration.vhostConfs.chloe = {
+        certName    = "eldiron";
+        hosts       = ["chloe.immae.eu" ];
+        root        = chloe_dev.webRoot;
+        extraConfig = [ chloe_dev.apache.vhostConf ];
+      };
     })
   ];
 }