diff options
Diffstat (limited to 'modules/private/websites/chloe/production.nix')
-rw-r--r-- | modules/private/websites/chloe/production.nix | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/modules/private/websites/chloe/production.nix b/modules/private/websites/chloe/production.nix new file mode 100644 index 00000000..0bf2d8fd --- /dev/null +++ b/modules/private/websites/chloe/production.nix | |||
@@ -0,0 +1,38 @@ | |||
1 | { lib, pkgs, config, myconfig, ... }: | ||
2 | let | ||
3 | chloe = pkgs.callPackage ./builder.nix { | ||
4 | inherit (pkgs.webapps) chloe; | ||
5 | config = myconfig.env.websites.chloe.production; | ||
6 | apacheUser = config.services.httpd.Prod.user; | ||
7 | apacheGroup = config.services.httpd.Prod.group; | ||
8 | }; | ||
9 | |||
10 | cfg = config.myServices.websites.chloe.production; | ||
11 | in { | ||
12 | options.myServices.websites.chloe.production.enable = lib.mkEnableOption "enable Chloe's website in production"; | ||
13 | |||
14 | config = lib.mkIf cfg.enable { | ||
15 | secrets.keys = chloe.keys; | ||
16 | services.webstats.sites = [ { name = "osteopathe-cc.fr"; } ]; | ||
17 | |||
18 | systemd.services.phpfpm-chloe_prod.after = lib.mkAfter chloe.phpFpm.serviceDeps; | ||
19 | systemd.services.phpfpm-chloe_prod.wants = chloe.phpFpm.serviceDeps; | ||
20 | services.phpfpm.pools.chloe_prod = { | ||
21 | listen = chloe.phpFpm.socket; | ||
22 | extraConfig = chloe.phpFpm.pool; | ||
23 | phpOptions = config.services.phpfpm.phpOptions + '' | ||
24 | extension=${pkgs.php}/lib/php/extensions/mysqli.so | ||
25 | ''; | ||
26 | }; | ||
27 | system.activationScripts.chloe_prod = chloe.activationScript; | ||
28 | myServices.websites.webappDirs."${chloe.apache.webappName}" = chloe.app.webRoot; | ||
29 | services.websites.production.modules = chloe.apache.modules; | ||
30 | services.websites.production.vhostConfs.chloe = { | ||
31 | certName = "chloe"; | ||
32 | certMainHost = "osteopathe-cc.fr"; | ||
33 | hosts = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ]; | ||
34 | root = chloe.apache.root; | ||
35 | extraConfig = [ chloe.apache.vhostConf ]; | ||
36 | }; | ||
37 | }; | ||
38 | } | ||