]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - virtual/modules/websites/chloe.nix
Add http configuration to modules and separate production from
[perso/Immae/Config/Nix.git] / virtual / modules / websites / chloe.nix
CommitLineData
3013caf1
IB
1{ lib, pkgs, config, mylibs, ... }:
2let
86f6924f
IB
3 chloe = pkgs.callPackage ../../packages/chloe.nix { inherit (mylibs) checkEnv fetchedGitPrivate; };
4 chloe_dev = chloe { environment = "dev"; };
5 chloe_prod = chloe { environment = "prod"; };
6
3013caf1
IB
7 cfg = config.services.myWebsites.Chloe;
8in {
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 config = lib.mkMerge [
19 (lib.mkIf cfg.production.enable {
20 security.acme.certs."chloe" = config.services.myCertificates.certConfig // {
21 domain = "osteopathe-cc.fr";
22 extraDomains = {
23 "www.osteopathe-cc.fr" = null;
24 };
25 };
86f6924f
IB
26
27 services.phpfpm.poolConfigs.chloe_prod = chloe_prod.phpFpm.pool;
28 system.activationScripts.chloe_prod = chloe_prod.activationScript;
f8bde3d6
IB
29 services.myWebsites.production.modules = chloe_prod.apache.modules;
30 services.myWebsites.production.vhostConfs.chloe = {
31 certName = "chloe";
32 hosts = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ];
33 root = chloe_prod.webRoot;
34 extraConfig = [ chloe_prod.apache.vhostConf ];
35 };
3013caf1
IB
36 })
37 (lib.mkIf cfg.integration.enable {
38 security.acme.certs."eldiron".extraDomains."chloe.immae.eu" = null;
86f6924f
IB
39 services.phpfpm.poolConfigs.chloe_dev = chloe_dev.phpFpm.pool;
40 system.activationScripts.chloe_dev = chloe_dev.activationScript;
f8bde3d6
IB
41 services.myWebsites.integration.modules = chloe_dev.apache.modules;
42 services.myWebsites.integration.vhostConfs.chloe = {
43 certName = "eldiron";
44 hosts = ["chloe.immae.eu" ];
45 root = chloe_dev.webRoot;
46 extraConfig = [ chloe_dev.apache.vhostConf ];
47 };
3013caf1
IB
48 })
49 ];
50}