diff options
Diffstat (limited to 'modules/private/websites/chloe/production.nix')
-rw-r--r-- | modules/private/websites/chloe/production.nix | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/modules/private/websites/chloe/production.nix b/modules/private/websites/chloe/production.nix new file mode 100644 index 0000000..0eafebd --- /dev/null +++ b/modules/private/websites/chloe/production.nix | |||
@@ -0,0 +1,37 @@ | |||
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 | services.myPhpfpm.serviceDependencies.chloe_prod = chloe.phpFpm.serviceDeps; | ||
19 | services.myPhpfpm.poolConfigs.chloe_prod = chloe.phpFpm.pool; | ||
20 | services.myPhpfpm.poolPhpConfigs.chloe_prod = '' | ||
21 | extension=${pkgs.php}/lib/php/extensions/mysqli.so | ||
22 | ''; | ||
23 | system.activationScripts.chloe_prod = chloe.activationScript; | ||
24 | system.extraSystemBuilderCmds = '' | ||
25 | mkdir -p $out/webapps | ||
26 | ln -s ${chloe.app.webRoot} $out/webapps/${chloe.apache.webappName} | ||
27 | ''; | ||
28 | services.websites.production.modules = chloe.apache.modules; | ||
29 | services.websites.production.vhostConfs.chloe = { | ||
30 | certName = "chloe"; | ||
31 | certMainHost = "osteopathe-cc.fr"; | ||
32 | hosts = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ]; | ||
33 | root = chloe.apache.root; | ||
34 | extraConfig = [ chloe.apache.vhostConf ]; | ||
35 | }; | ||
36 | }; | ||
37 | } | ||