1 { lib, config, pkgs, ... }:
3 cfg = config.myServices.websites.christophe_carpentier.agora-project;
4 varDir = "/var/lib/ftp/christophe_carpentier/agora-project";
5 apacheUser = config.services.httpd.Inte.user;
6 apacheGroup = config.services.httpd.Inte.group;
8 options.myServices.websites.christophe_carpentier.agora-project.enable = lib.mkEnableOption "enable Christophe Carpentier's agora-project";
10 config = lib.mkIf cfg.enable {
11 system.activationScripts.christophe_carpentier_agora_project = {
12 deps = [ "httpd" "users" ];
14 install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d ${varDir}
15 install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d /var/lib/php/sessions/christophe_carpentier
18 services.phpfpm.pools.christophe_carpentier_agora_project = {
22 "listen.owner" = apacheUser;
23 "listen.group" = apacheGroup;
26 "pm.max_children" = "5";
27 "pm.process_idle_timeout" = "60";
29 "php_admin_value[open_basedir]" = "/var/lib/php/sessions/christophe_carpentier:${varDir}:/tmp";
30 "php_admin_value[session.save_path]" = "/var/lib/php/sessions/christophe_carpentier";
31 "php_admin_value[upload_max_filesize]" = "20M";
32 "php_admin_value[post_max_size]" = "20M";
34 phpOptions = config.services.phpfpm.phpOptions + ''
35 disable_functions = "mail"
37 phpPackage = pkgs.php74;
39 services.websites.env.production.modules = [ "proxy_fcgi" ];
40 services.websites.env.integration.vhostConfs.christophe_carpentier_agora_project = {
41 certName = "integration";
43 hosts = ["agora-project.cc.immae.dev"];
48 SetHandler "proxy:unix:${config.services.phpfpm.pools.christophe_carpentier_agora_project.socket}|fcgi://localhost"
52 DirectoryIndex index.php index.htm index.html
53 Options Indexes FollowSymLinks MultiViews Includes