]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/chloe/production.nix
0eafebdc6e76d41160b8b5f8527252536ed52deb
[perso/Immae/Config/Nix.git] / modules / private / websites / chloe / production.nix
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 }