]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - nixops/modules/websites/chloe/default.nix
Refactor a bit httpd/webapps configuration:
[perso/Immae/Config/Nix.git] / nixops / modules / websites / chloe / default.nix
index 898007704dbef6ad24057769cf8e8a1bc69f4b08..ce67bedd5d83875369e8fd9c097990d86c6636ba 100644 (file)
@@ -1,14 +1,15 @@
-{ lib, pkgs, config, myconfig, mylibs, ... }:
+{ lib, pkgs, config, myconfig,  ... }:
 let
-    chloe = pkgs.callPackage ./chloe.nix { inherit (mylibs) fetchedGitPrivate; };
-    chloe_dev  = chloe {
-      config = myconfig.env.websites.chloe.integration;
-    };
-    chloe_prod = chloe {
-      config = myconfig.env.websites.chloe.production;
-    };
+  chloe_dev  = pkgs.callPackage ./chloe.nix {
+    inherit (pkgs.webapps) chloe;
+    config = myconfig.env.websites.chloe.integration;
+  };
+  chloe_prod = pkgs.callPackage ./chloe.nix {
+    inherit (pkgs.webapps) chloe;
+    config = myconfig.env.websites.chloe.production;
+  };
 
-    cfg = config.services.myWebsites.Chloe;
+  cfg = config.services.myWebsites.Chloe;
 in {
   options.services.myWebsites.Chloe = {
     production = {
@@ -19,17 +20,10 @@ in {
     };
   };
 
-  imports = [
-    ../commons/stats.nix
-  ];
-
   config = lib.mkMerge [
     (lib.mkIf cfg.production.enable {
       secrets.keys = chloe_prod.keys;
-      services.myWebsites.commons.stats.enable = true;
-      services.myWebsites.commons.stats.sites = [
-        { name = "osteopathe-cc.fr"; }
-      ];
+      services.webstats.sites = [ { name = "osteopathe-cc.fr"; } ];
 
       security.acme.certs."chloe" = config.services.myCertificates.certConfig // {
         domain = "osteopathe-cc.fr";
@@ -46,7 +40,7 @@ in {
       system.activationScripts.chloe_prod = chloe_prod.activationScript;
       system.extraSystemBuilderCmds = ''
         mkdir -p $out/webapps
-        ln -s ${chloe_prod.webRoot} $out/webapps/${chloe_prod.apache.webappName}
+        ln -s ${chloe_prod.app.webRoot} $out/webapps/${chloe_prod.apache.webappName}
         '';
       services.myWebsites.production.modules = chloe_prod.apache.modules;
       services.myWebsites.production.vhostConfs.chloe = {
@@ -67,7 +61,7 @@ in {
       system.activationScripts.chloe_dev = chloe_dev.activationScript;
       system.extraSystemBuilderCmds = ''
         mkdir -p $out/webapps
-        ln -s ${chloe_dev.webRoot} $out/webapps/${chloe_dev.apache.webappName}
+        ln -s ${chloe_dev.app.webRoot} $out/webapps/${chloe_dev.apache.webappName}
         '';
       services.myWebsites.integration.modules = chloe_dev.apache.modules;
       services.myWebsites.integration.vhostConfs.chloe = {