]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - modules/private/websites/chloe/integration.nix
Add specification for the private config file as a module.
[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 = {
20 listen = chloe.phpFpm.socket;
21 extraConfig = chloe.phpFpm.pool;
22 phpOptions = config.services.phpfpm.phpOptions + ''
23 extension=${pkgs.php}/lib/php/extensions/mysqli.so
f8026b6e 24 '';
f40f5b23 25 };
f8026b6e 26 system.activationScripts.chloe_dev = chloe.activationScript;
4288c2f2 27 myServices.websites.webappDirs."${chloe.apache.webappName}" = chloe.app.webRoot;
29f8cb85
IB
28 services.websites.env.integration.modules = chloe.apache.modules;
29 services.websites.env.integration.vhostConfs.chloe = {
f8026b6e
IB
30 certName = "eldiron";
31 addToCerts = true;
32 hosts = ["chloe.immae.eu" ];
33 root = chloe.apache.root;
34 extraConfig = [ chloe.apache.vhostConf ];
35 };
29f8cb85 36 services.websites.env.integration.watchPaths = [
17f6eae9
IB
37 "/var/secrets/webapps/${chloe.app.environment}-chloe"
38 ];
f8026b6e
IB
39 };
40}