]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - nixops/modules/websites/chloe/default.nix
Rename virtual folder to nixops
[perso/Immae/Config/Nix.git] / nixops / modules / websites / chloe / default.nix
CommitLineData
9d90e7e2 1{ lib, pkgs, config, myconfig, mylibs, ... }:
3013caf1 2let
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;
12in {
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 {
e4a945cd
IB
28 services.myWebsites.commons.stats.enable = true;
29 services.myWebsites.commons.stats.sites = [
30 {
31 name = "osteopathe-cc.fr";
091ae734 32 conf = ./goaccess.conf;
e4a945cd
IB
33 }
34 ];
35
3013caf1
IB
36 security.acme.certs."chloe" = config.services.myCertificates.certConfig // {
37 domain = "osteopathe-cc.fr";
38 extraDomains = {
39 "www.osteopathe-cc.fr" = null;
40 };
41 };
86f6924f 42
98584540 43 services.myPhpfpm.poolConfigs.chloe_prod = chloe_prod.phpFpm.pool;
912921a7
IB
44 services.myPhpfpm.poolPhpConfigs.chloe_prod = ''
45 extension=${pkgs.php}/lib/php/extensions/mysqli.so
46 '';
86f6924f 47 system.activationScripts.chloe_prod = chloe_prod.activationScript;
f8bde3d6
IB
48 services.myWebsites.production.modules = chloe_prod.apache.modules;
49 services.myWebsites.production.vhostConfs.chloe = {
50 certName = "chloe";
51 hosts = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ];
52 root = chloe_prod.webRoot;
53 extraConfig = [ chloe_prod.apache.vhostConf ];
54 };
3013caf1
IB
55 })
56 (lib.mkIf cfg.integration.enable {
57 security.acme.certs."eldiron".extraDomains."chloe.immae.eu" = null;
98584540 58 services.myPhpfpm.poolConfigs.chloe_dev = chloe_dev.phpFpm.pool;
62a0946e 59 services.myPhpfpm.poolPhpConfigs.chloe_dev = ''
912921a7
IB
60 extension=${pkgs.php}/lib/php/extensions/mysqli.so
61 '';
86f6924f 62 system.activationScripts.chloe_dev = chloe_dev.activationScript;
f8bde3d6
IB
63 services.myWebsites.integration.modules = chloe_dev.apache.modules;
64 services.myWebsites.integration.vhostConfs.chloe = {
65 certName = "eldiron";
66 hosts = ["chloe.immae.eu" ];
67 root = chloe_dev.webRoot;
68 extraConfig = [ chloe_dev.apache.vhostConf ];
69 };
3013caf1
IB
70 })
71 ];
72}