1 { lib, pkgs, config, myconfig, mylibs, ... }:
3 chloe = pkgs.callPackage ./chloe.nix { inherit (mylibs) fetchedGitPrivate; };
5 config = myconfig.env.websites.chloe.integration;
8 config = myconfig.env.websites.chloe.production;
11 cfg = config.services.myWebsites.Chloe;
13 options.services.myWebsites.Chloe = {
15 enable = lib.mkEnableOption "enable Chloe's website in production";
18 enable = lib.mkEnableOption "enable Chloe's website in integration";
26 config = lib.mkMerge [
27 (lib.mkIf cfg.production.enable {
28 deployment.keys = chloe_prod.keys;
29 services.myWebsites.commons.stats.enable = true;
30 services.myWebsites.commons.stats.sites = [
32 name = "osteopathe-cc.fr";
33 conf = ./goaccess.conf;
37 security.acme.certs."chloe" = config.services.myCertificates.certConfig // {
38 domain = "osteopathe-cc.fr";
40 "www.osteopathe-cc.fr" = null;
44 services.myPhpfpm.serviceDependencies.chloe_prod = chloe_prod.phpFpm.serviceDeps;
45 services.myPhpfpm.poolConfigs.chloe_prod = chloe_prod.phpFpm.pool;
46 services.myPhpfpm.poolPhpConfigs.chloe_prod = ''
47 extension=${pkgs.php}/lib/php/extensions/mysqli.so
49 system.activationScripts.chloe_prod = chloe_prod.activationScript;
50 system.extraSystemBuilderCmds = ''
52 ln -s ${chloe_prod.webRoot} $out/webapps/${chloe_prod.apache.webappName}
54 services.myWebsites.production.modules = chloe_prod.apache.modules;
55 services.myWebsites.production.vhostConfs.chloe = {
57 hosts = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ];
58 root = chloe_prod.apache.root;
59 extraConfig = [ chloe_prod.apache.vhostConf ];
62 (lib.mkIf cfg.integration.enable {
63 deployment.keys = chloe_dev.keys;
64 security.acme.certs."eldiron".extraDomains."chloe.immae.eu" = null;
65 services.myPhpfpm.serviceDependencies.chloe_dev = chloe_dev.phpFpm.serviceDeps;
66 services.myPhpfpm.poolConfigs.chloe_dev = chloe_dev.phpFpm.pool;
67 services.myPhpfpm.poolPhpConfigs.chloe_dev = ''
68 extension=${pkgs.php}/lib/php/extensions/mysqli.so
70 system.activationScripts.chloe_dev = chloe_dev.activationScript;
71 system.extraSystemBuilderCmds = ''
73 ln -s ${chloe_dev.webRoot} $out/webapps/${chloe_dev.apache.webappName}
75 services.myWebsites.integration.modules = chloe_dev.apache.modules;
76 services.myWebsites.integration.vhostConfs.chloe = {
78 hosts = ["chloe.immae.eu" ];
79 root = chloe_dev.apache.root;
80 extraConfig = [ chloe_dev.apache.vhostConf ];