]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - modules/private/websites/chloe/integration.nix
Upgrade nixos
[perso/Immae/Config/Nix.git] / modules / private / websites / chloe / integration.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.integration;
f8026b6e
IB
6 apacheUser = config.services.httpd.Inte.user;
7 apacheGroup = config.services.httpd.Inte.group;
8 };
9
10 cfg = config.myServices.websites.chloe.integration;
11in {
12 options.myServices.websites.chloe.integration.enable = lib.mkEnableOption "enable Chloe's website in integration";
13
14 config = lib.mkIf cfg.enable {
d2e703c5 15 services.duplyBackup.profiles.chloe_dev.rootDir = chloe.app.varDir;
f8026b6e 16 secrets.keys = chloe.keys;
f40f5b23
IB
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 = {
5400b9b6
IB
20 user = config.services.httpd.Inte.user;
21 group = config.services.httpd.Inte.group;
22 settings = chloe.phpFpm.pool;
f40f5b23
IB
23 phpOptions = config.services.phpfpm.phpOptions + ''
24 extension=${pkgs.php}/lib/php/extensions/mysqli.so
f8026b6e 25 '';
f40f5b23 26 };
f8026b6e 27 system.activationScripts.chloe_dev = chloe.activationScript;
4288c2f2 28 myServices.websites.webappDirs."${chloe.apache.webappName}" = chloe.app.webRoot;
29f8cb85
IB
29 services.websites.env.integration.modules = chloe.apache.modules;
30 services.websites.env.integration.vhostConfs.chloe = {
0f71cd76 31 certName = "integration";
f8026b6e
IB
32 addToCerts = true;
33 hosts = ["chloe.immae.eu" ];
34 root = chloe.apache.root;
5400b9b6
IB
35 extraConfig = [
36 (chloe.apache.vhostConf config.services.phpfpm.pools.chloe_dev.socket)
37 ];
f8026b6e 38 };
29f8cb85 39 services.websites.env.integration.watchPaths = [
17f6eae9
IB
40 "/var/secrets/webapps/${chloe.app.environment}-chloe"
41 ];
f8026b6e
IB
42 };
43}