]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - modules/private/websites/chloe/production.nix
Add specification for the private config file as a module.
[perso/Immae/Config/Nix.git] / modules / private / websites / chloe / production.nix
CommitLineData
ab8f306d 1{ lib, pkgs, config, ... }:
f8026b6e
IB
2let
3 chloe = pkgs.callPackage ./builder.nix {
4 inherit (pkgs.webapps) chloe;
ab8f306d 5 config = config.myEnv.websites.chloe.production;
f8026b6e
IB
6 apacheUser = config.services.httpd.Prod.user;
7 apacheGroup = config.services.httpd.Prod.group;
8 };
9
10 cfg = config.myServices.websites.chloe.production;
11in {
12 options.myServices.websites.chloe.production.enable = lib.mkEnableOption "enable Chloe's website in production";
13
14 config = lib.mkIf cfg.enable {
d2e703c5 15 services.duplyBackup.profiles.chloe_prod.rootDir = chloe.app.varDir;
f8026b6e
IB
16 secrets.keys = chloe.keys;
17 services.webstats.sites = [ { name = "osteopathe-cc.fr"; } ];
18
f40f5b23
IB
19 systemd.services.phpfpm-chloe_prod.after = lib.mkAfter chloe.phpFpm.serviceDeps;
20 systemd.services.phpfpm-chloe_prod.wants = chloe.phpFpm.serviceDeps;
21 services.phpfpm.pools.chloe_prod = {
22 listen = chloe.phpFpm.socket;
23 extraConfig = chloe.phpFpm.pool;
24 phpOptions = config.services.phpfpm.phpOptions + ''
25 extension=${pkgs.php}/lib/php/extensions/mysqli.so
f8026b6e 26 '';
f40f5b23 27 };
f8026b6e 28 system.activationScripts.chloe_prod = chloe.activationScript;
4288c2f2 29 myServices.websites.webappDirs."${chloe.apache.webappName}" = chloe.app.webRoot;
29f8cb85
IB
30 services.websites.env.production.modules = chloe.apache.modules;
31 services.websites.env.production.vhostConfs.chloe = {
f8026b6e
IB
32 certName = "chloe";
33 certMainHost = "osteopathe-cc.fr";
34 hosts = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ];
35 root = chloe.apache.root;
36 extraConfig = [ chloe.apache.vhostConf ];
37 };
29f8cb85 38 services.websites.env.production.watchPaths = [
17f6eae9
IB
39 "/var/secrets/webapps/${chloe.app.environment}-chloe"
40 ];
f8026b6e
IB
41 };
42}