]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/chloe/production.nix
Replace myPhpfpm with correct overrides
[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 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 system.extraSystemBuilderCmds = ''
29 mkdir -p $out/webapps
30 ln -s ${chloe.app.webRoot} $out/webapps/${chloe.apache.webappName}
31 '';
32 services.websites.production.modules = chloe.apache.modules;
33 services.websites.production.vhostConfs.chloe = {
34 certName = "chloe";
35 certMainHost = "osteopathe-cc.fr";
36 hosts = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ];
37 root = chloe.apache.root;
38 extraConfig = [ chloe.apache.vhostConf ];
39 };
40 };
41 }