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";
22 config = lib.mkMerge [
23 (lib.mkIf cfg.production.enable {
24 secrets.keys = chloe_prod.keys;
25 services.webstats.sites = [ { name = "osteopathe-cc.fr"; } ];
27 security.acme.certs."chloe" = config.services.myCertificates.certConfig // {
28 domain = "osteopathe-cc.fr";
30 "www.osteopathe-cc.fr" = null;
34 services.myPhpfpm.serviceDependencies.chloe_prod = chloe_prod.phpFpm.serviceDeps;
35 services.myPhpfpm.poolConfigs.chloe_prod = chloe_prod.phpFpm.pool;
36 services.myPhpfpm.poolPhpConfigs.chloe_prod = ''
37 extension=${pkgs.php}/lib/php/extensions/mysqli.so
39 system.activationScripts.chloe_prod = chloe_prod.activationScript;
40 system.extraSystemBuilderCmds = ''
42 ln -s ${chloe_prod.webRoot} $out/webapps/${chloe_prod.apache.webappName}
44 services.myWebsites.production.modules = chloe_prod.apache.modules;
45 services.myWebsites.production.vhostConfs.chloe = {
47 hosts = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ];
48 root = chloe_prod.apache.root;
49 extraConfig = [ chloe_prod.apache.vhostConf ];
52 (lib.mkIf cfg.integration.enable {
53 secrets.keys = chloe_dev.keys;
54 security.acme.certs."eldiron".extraDomains."chloe.immae.eu" = null;
55 services.myPhpfpm.serviceDependencies.chloe_dev = chloe_dev.phpFpm.serviceDeps;
56 services.myPhpfpm.poolConfigs.chloe_dev = chloe_dev.phpFpm.pool;
57 services.myPhpfpm.poolPhpConfigs.chloe_dev = ''
58 extension=${pkgs.php}/lib/php/extensions/mysqli.so
60 system.activationScripts.chloe_dev = chloe_dev.activationScript;
61 system.extraSystemBuilderCmds = ''
63 ln -s ${chloe_dev.webRoot} $out/webapps/${chloe_dev.apache.webappName}
65 services.myWebsites.integration.modules = chloe_dev.apache.modules;
66 services.myWebsites.integration.vhostConfs.chloe = {
68 hosts = ["chloe.immae.eu" ];
69 root = chloe_dev.apache.root;
70 extraConfig = [ chloe_dev.apache.vhostConf ];