]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/chloe/integration.nix
458e41450dc8fb990208ea4d46baf594be5a1233
[perso/Immae/Config/Nix.git] / modules / private / websites / chloe / integration.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.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 secrets.keys = chloe.keys;
16 services.myPhpfpm.serviceDependencies.chloe_dev = chloe.phpFpm.serviceDeps;
17 services.myPhpfpm.poolConfigs.chloe_dev = chloe.phpFpm.pool;
18 services.myPhpfpm.poolPhpConfigs.chloe_dev = ''
19 extension=${pkgs.php}/lib/php/extensions/mysqli.so
20 '';
21 system.activationScripts.chloe_dev = chloe.activationScript;
22 system.extraSystemBuilderCmds = ''
23 mkdir -p $out/webapps
24 ln -s ${chloe.app.webRoot} $out/webapps/${chloe.apache.webappName}
25 '';
26 services.websites.integration.modules = chloe.apache.modules;
27 services.websites.integration.vhostConfs.chloe = {
28 certName = "eldiron";
29 addToCerts = true;
30 hosts = ["chloe.immae.eu" ];
31 root = chloe.apache.root;
32 extraConfig = [ chloe.apache.vhostConf ];
33 };
34 };
35 }