1 { lib, config, pkgs, ... }:
3 cfg = config.myServices.websites.christophe_carpentier.website;
4 varDir = "/var/lib/ftp/christophe_carpentier/website";
5 apacheUser = config.services.httpd.Inte.user;
6 apacheGroup = config.services.httpd.Inte.group;
8 options.myServices.websites.christophe_carpentier.website.enable = lib.mkEnableOption "enable Christophe Carpentier's website";
10 config = lib.mkIf cfg.enable {
11 system.activationScripts.christophe_carpentier_website = {
12 deps = [ "httpd" "users" ];
14 install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d ${varDir}
17 services.phpfpm.pools.christophe_carpentier_website = {
21 "listen.owner" = apacheUser;
22 "listen.group" = apacheGroup;
25 "pm.max_children" = "5";
26 "pm.process_idle_timeout" = "60";
28 "php_admin_value[session.save_handler]" = "redis";
29 "php_admin_value[session.save_path]" = "'unix:///run/redis-php-sessions/redis.sock?persistent=1&prefix=ChristopheCarpentier:website:'";
30 "php_admin_value[open_basedir]" = "${varDir}:/tmp";
32 phpOptions = config.services.phpfpm.phpOptions + ''
33 disable_functions = "mail"
35 phpPackage = pkgs.php72.withExtensions ({ enabled, all }: enabled ++ [all.redis]);
37 services.websites.env.production.modules = [ "proxy_fcgi" ];
38 services.websites.env.integration.vhostConfs.christophe_carpentier_website = {
39 certName = "integration";
41 hosts = ["www.cc.immae.dev" "cc.immae.dev"];
46 SetHandler "proxy:unix:${config.services.phpfpm.pools.christophe_carpentier_website.socket}|fcgi://localhost"
50 DirectoryIndex index.php index.htm index.html
51 Options Indexes FollowSymLinks MultiViews Includes