]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/chloe/integration.nix
Upgrade nixos
[perso/Immae/Config/Nix.git] / modules / private / websites / chloe / integration.nix
1 { lib, pkgs, config, ... }:
2 let
3 chloe = pkgs.callPackage ./builder.nix {
4 inherit (pkgs.webapps) chloe;
5 config = config.myEnv.websites.chloe.integration;
6 apacheUser = config.services.httpd.Inte.user;
7 apacheGroup = config.services.httpd.Inte.group;
8 };
9
10 cfg = config.myServices.websites.chloe.integration;
11 in {
12 options.myServices.websites.chloe.integration.enable = lib.mkEnableOption "enable Chloe's website in integration";
13
14 config = lib.mkIf cfg.enable {
15 services.duplyBackup.profiles.chloe_dev.rootDir = chloe.app.varDir;
16 secrets.keys = chloe.keys;
17 systemd.services.phpfpm-chloe_dev.after = lib.mkAfter chloe.phpFpm.serviceDeps;
18 systemd.services.phpfpm-chloe_dev.wants = chloe.phpFpm.serviceDeps;
19 services.phpfpm.pools.chloe_dev = {
20 user = config.services.httpd.Inte.user;
21 group = config.services.httpd.Inte.group;
22 settings = chloe.phpFpm.pool;
23 phpOptions = config.services.phpfpm.phpOptions + ''
24 extension=${pkgs.php}/lib/php/extensions/mysqli.so
25 '';
26 };
27 system.activationScripts.chloe_dev = chloe.activationScript;
28 myServices.websites.webappDirs."${chloe.apache.webappName}" = chloe.app.webRoot;
29 services.websites.env.integration.modules = chloe.apache.modules;
30 services.websites.env.integration.vhostConfs.chloe = {
31 certName = "integration";
32 addToCerts = true;
33 hosts = ["chloe.immae.eu" ];
34 root = chloe.apache.root;
35 extraConfig = [
36 (chloe.apache.vhostConf config.services.phpfpm.pools.chloe_dev.socket)
37 ];
38 };
39 services.websites.env.integration.watchPaths = [
40 "/var/secrets/webapps/${chloe.app.environment}-chloe"
41 ];
42 };
43 }