diff options
Diffstat (limited to 'virtual/modules/websites/chloe/default.nix')
-rw-r--r-- | virtual/modules/websites/chloe/default.nix | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/virtual/modules/websites/chloe/default.nix b/virtual/modules/websites/chloe/default.nix new file mode 100644 index 0000000..72a9b6f --- /dev/null +++ b/virtual/modules/websites/chloe/default.nix | |||
@@ -0,0 +1,62 @@ | |||
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.phpfpm.poolConfigs.chloe_prod = chloe_prod.phpFpm.pool; | ||
40 | system.activationScripts.chloe_prod = chloe_prod.activationScript; | ||
41 | services.myWebsites.production.modules = chloe_prod.apache.modules; | ||
42 | services.myWebsites.production.vhostConfs.chloe = { | ||
43 | certName = "chloe"; | ||
44 | hosts = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ]; | ||
45 | root = chloe_prod.webRoot; | ||
46 | extraConfig = [ chloe_prod.apache.vhostConf ]; | ||
47 | }; | ||
48 | }) | ||
49 | (lib.mkIf cfg.integration.enable { | ||
50 | security.acme.certs."eldiron".extraDomains."chloe.immae.eu" = null; | ||
51 | services.phpfpm.poolConfigs.chloe_dev = chloe_dev.phpFpm.pool; | ||
52 | system.activationScripts.chloe_dev = chloe_dev.activationScript; | ||
53 | services.myWebsites.integration.modules = chloe_dev.apache.modules; | ||
54 | services.myWebsites.integration.vhostConfs.chloe = { | ||
55 | certName = "eldiron"; | ||
56 | hosts = ["chloe.immae.eu" ]; | ||
57 | root = chloe_dev.webRoot; | ||
58 | extraConfig = [ chloe_dev.apache.vhostConf ]; | ||
59 | }; | ||
60 | }) | ||
61 | ]; | ||
62 | } | ||