]>
Commit | Line | Data |
---|---|---|
f8026b6e IB |
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 | ||
f40f5b23 IB |
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 | |
f8026b6e | 25 | ''; |
f40f5b23 | 26 | }; |
f8026b6e | 27 | system.activationScripts.chloe_prod = chloe.activationScript; |
4288c2f2 | 28 | myServices.websites.webappDirs."${chloe.apache.webappName}" = chloe.app.webRoot; |
29f8cb85 IB |
29 | services.websites.env.production.modules = chloe.apache.modules; |
30 | services.websites.env.production.vhostConfs.chloe = { | |
f8026b6e IB |
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 | }; | |
29f8cb85 | 37 | services.websites.env.production.watchPaths = [ |
17f6eae9 IB |
38 | "/var/secrets/webapps/${chloe.app.environment}-chloe" |
39 | ]; | |
f8026b6e IB |
40 | }; |
41 | } |