]>
Commit | Line | Data |
---|---|---|
1 | { lib, pkgs, config, mylibs, ... }: | |
2 | let | |
3 | chloe = pkgs.callPackage ./chloe.nix { inherit (mylibs) checkEnv fetchedGitPrivate; }; | |
4 | chloe_dev = chloe { environment = "dev"; }; | |
5 | chloe_prod = chloe { environment = "prod"; }; | |
6 | ||
7 | cfg = config.services.myWebsites.Chloe; | |
8 | in { | |
9 | options.services.myWebsites.Chloe = { | |
10 | production = { | |
11 | enable = lib.mkEnableOption "enable Chloe's website in production"; | |
12 | }; | |
13 | integration = { | |
14 | enable = lib.mkEnableOption "enable Chloe's website in integration"; | |
15 | }; | |
16 | }; | |
17 | ||
18 | imports = [ | |
19 | ../commons/stats.nix | |
20 | ]; | |
21 | ||
22 | config = lib.mkMerge [ | |
23 | (lib.mkIf cfg.production.enable { | |
24 | services.myWebsites.commons.stats.enable = true; | |
25 | services.myWebsites.commons.stats.sites = [ | |
26 | { | |
27 | name = "osteopathe-cc.fr"; | |
28 | conf = ./goaccess.conf; | |
29 | } | |
30 | ]; | |
31 | ||
32 | security.acme.certs."chloe" = config.services.myCertificates.certConfig // { | |
33 | domain = "osteopathe-cc.fr"; | |
34 | extraDomains = { | |
35 | "www.osteopathe-cc.fr" = null; | |
36 | }; | |
37 | }; | |
38 | ||
39 | services.myPhpfpm.poolConfigs.chloe_prod = chloe_prod.phpFpm.pool; | |
40 | services.myPhpfpm.poolPhpConfigs.chloe_prod = '' | |
41 | extension=${pkgs.php}/lib/php/extensions/mysqli.so | |
42 | ''; | |
43 | system.activationScripts.chloe_prod = chloe_prod.activationScript; | |
44 | services.myWebsites.production.modules = chloe_prod.apache.modules; | |
45 | services.myWebsites.production.vhostConfs.chloe = { | |
46 | certName = "chloe"; | |
47 | hosts = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ]; | |
48 | root = chloe_prod.webRoot; | |
49 | extraConfig = [ chloe_prod.apache.vhostConf ]; | |
50 | }; | |
51 | }) | |
52 | (lib.mkIf cfg.integration.enable { | |
53 | security.acme.certs."eldiron".extraDomains."chloe.immae.eu" = null; | |
54 | services.myPhpfpm.poolConfigs.chloe_dev = chloe_dev.phpFpm.pool; | |
55 | services.myPhpfpm.poolPhpConfigs.chloe_dev = '' | |
56 | extension=${pkgs.php}/lib/php/extensions/mysqli.so | |
57 | ''; | |
58 | system.activationScripts.chloe_dev = chloe_dev.activationScript; | |
59 | services.myWebsites.integration.modules = chloe_dev.apache.modules; | |
60 | services.myWebsites.integration.vhostConfs.chloe = { | |
61 | certName = "eldiron"; | |
62 | hosts = ["chloe.immae.eu" ]; | |
63 | root = chloe_dev.webRoot; | |
64 | extraConfig = [ chloe_dev.apache.vhostConf ]; | |
65 | }; | |
66 | }) | |
67 | ]; | |
68 | } |