]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/websites/chloe/production.nix
Add specification for the private config file as a module.
[perso/Immae/Config/Nix.git] / modules / private / websites / chloe / production.nix
index d4b22994d0a98d1c143ea60125253f82904f8323..3d267f2494595774004608769ddd7f60d028c926 100644 (file)
@@ -1,8 +1,8 @@
-{ lib, pkgs, config, myconfig,  ... }:
+{ lib, pkgs, config,  ... }:
 let
   chloe = pkgs.callPackage ./builder.nix {
     inherit (pkgs.webapps) chloe;
-    config = myconfig.env.websites.chloe.production;
+    config = config.myEnv.websites.chloe.production;
     apacheUser = config.services.httpd.Prod.user;
     apacheGroup = config.services.httpd.Prod.group;
   };
@@ -12,6 +12,7 @@ in {
   options.myServices.websites.chloe.production.enable = lib.mkEnableOption "enable Chloe's website in production";
 
   config = lib.mkIf cfg.enable {
+    services.duplyBackup.profiles.chloe_prod.rootDir = chloe.app.varDir;
     secrets.keys = chloe.keys;
     services.webstats.sites = [ { name = "osteopathe-cc.fr"; } ];
 
@@ -25,17 +26,17 @@ in {
       '';
     };
     system.activationScripts.chloe_prod = chloe.activationScript;
-    system.extraSystemBuilderCmds = ''
-      mkdir -p $out/webapps
-      ln -s ${chloe.app.webRoot} $out/webapps/${chloe.apache.webappName}
-      '';
-    services.websites.production.modules = chloe.apache.modules;
-    services.websites.production.vhostConfs.chloe = {
+    myServices.websites.webappDirs."${chloe.apache.webappName}" = chloe.app.webRoot;
+    services.websites.env.production.modules = chloe.apache.modules;
+    services.websites.env.production.vhostConfs.chloe = {
       certName     = "chloe";
       certMainHost = "osteopathe-cc.fr";
       hosts        = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ];
       root         = chloe.apache.root;
       extraConfig  = [ chloe.apache.vhostConf ];
     };
+    services.websites.env.production.watchPaths = [
+      "/var/secrets/webapps/${chloe.app.environment}-chloe"
+    ];
   };
 }