]>
Commit | Line | Data |
---|---|---|
9d90e7e2 | 1 | { lib, pkgs, config, myconfig, mylibs, ... }: |
3013caf1 | 2 | let |
9d90e7e2 IB |
3 | chloe = pkgs.callPackage ./chloe.nix { inherit (mylibs) fetchedGitPrivate; }; |
4 | chloe_dev = chloe { | |
5 | config = myconfig.env.websites.chloe.integration; | |
6 | }; | |
7 | chloe_prod = chloe { | |
8 | config = myconfig.env.websites.chloe.production; | |
9 | }; | |
86f6924f | 10 | |
3013caf1 IB |
11 | cfg = config.services.myWebsites.Chloe; |
12 | in { | |
13 | options.services.myWebsites.Chloe = { | |
14 | production = { | |
15 | enable = lib.mkEnableOption "enable Chloe's website in production"; | |
16 | }; | |
17 | integration = { | |
18 | enable = lib.mkEnableOption "enable Chloe's website in integration"; | |
19 | }; | |
20 | }; | |
21 | ||
091ae734 IB |
22 | imports = [ |
23 | ../commons/stats.nix | |
24 | ]; | |
25 | ||
3013caf1 IB |
26 | config = lib.mkMerge [ |
27 | (lib.mkIf cfg.production.enable { | |
1a718805 | 28 | secrets.keys = chloe_prod.keys; |
e4a945cd IB |
29 | services.myWebsites.commons.stats.enable = true; |
30 | services.myWebsites.commons.stats.sites = [ | |
b7ee93fc | 31 | { name = "osteopathe-cc.fr"; } |
e4a945cd IB |
32 | ]; |
33 | ||
3013caf1 IB |
34 | security.acme.certs."chloe" = config.services.myCertificates.certConfig // { |
35 | domain = "osteopathe-cc.fr"; | |
36 | extraDomains = { | |
37 | "www.osteopathe-cc.fr" = null; | |
38 | }; | |
39 | }; | |
86f6924f | 40 | |
906065a0 | 41 | services.myPhpfpm.serviceDependencies.chloe_prod = chloe_prod.phpFpm.serviceDeps; |
98584540 | 42 | services.myPhpfpm.poolConfigs.chloe_prod = chloe_prod.phpFpm.pool; |
912921a7 IB |
43 | services.myPhpfpm.poolPhpConfigs.chloe_prod = '' |
44 | extension=${pkgs.php}/lib/php/extensions/mysqli.so | |
45 | ''; | |
86f6924f | 46 | system.activationScripts.chloe_prod = chloe_prod.activationScript; |
e5073add IB |
47 | system.extraSystemBuilderCmds = '' |
48 | mkdir -p $out/webapps | |
49 | ln -s ${chloe_prod.webRoot} $out/webapps/${chloe_prod.apache.webappName} | |
50 | ''; | |
f8bde3d6 IB |
51 | services.myWebsites.production.modules = chloe_prod.apache.modules; |
52 | services.myWebsites.production.vhostConfs.chloe = { | |
53 | certName = "chloe"; | |
54 | hosts = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ]; | |
7da3ceec | 55 | root = chloe_prod.apache.root; |
f8bde3d6 IB |
56 | extraConfig = [ chloe_prod.apache.vhostConf ]; |
57 | }; | |
3013caf1 IB |
58 | }) |
59 | (lib.mkIf cfg.integration.enable { | |
1a718805 | 60 | secrets.keys = chloe_dev.keys; |
3013caf1 | 61 | security.acme.certs."eldiron".extraDomains."chloe.immae.eu" = null; |
906065a0 | 62 | services.myPhpfpm.serviceDependencies.chloe_dev = chloe_dev.phpFpm.serviceDeps; |
98584540 | 63 | services.myPhpfpm.poolConfigs.chloe_dev = chloe_dev.phpFpm.pool; |
62a0946e | 64 | services.myPhpfpm.poolPhpConfigs.chloe_dev = '' |
912921a7 IB |
65 | extension=${pkgs.php}/lib/php/extensions/mysqli.so |
66 | ''; | |
86f6924f | 67 | system.activationScripts.chloe_dev = chloe_dev.activationScript; |
e5073add IB |
68 | system.extraSystemBuilderCmds = '' |
69 | mkdir -p $out/webapps | |
70 | ln -s ${chloe_dev.webRoot} $out/webapps/${chloe_dev.apache.webappName} | |
71 | ''; | |
f8bde3d6 IB |
72 | services.myWebsites.integration.modules = chloe_dev.apache.modules; |
73 | services.myWebsites.integration.vhostConfs.chloe = { | |
74 | certName = "eldiron"; | |
75 | hosts = ["chloe.immae.eu" ]; | |
e5073add | 76 | root = chloe_dev.apache.root; |
f8bde3d6 IB |
77 | extraConfig = [ chloe_dev.apache.vhostConf ]; |
78 | }; | |
3013caf1 IB |
79 | }) |
80 | ]; | |
81 | } |