1 { lib, pkgs, config, ... }:
3 cfg = config.myServices.websites.evariste.production;
4 nsiVarDir = "/var/lib/ftp/nsievariste";
5 stmgVarDir = "/var/lib/ftp/stmgevariste";
7 options.myServices.websites.evariste.production.enable = lib.mkEnableOption "enable NSI/STMG Evariste website";
9 config = lib.mkIf cfg.enable {
10 services.webstats.sites = [
11 { name = "nsievariste.immae.eu"; }
12 { name = "stmgevariste.immae.eu"; }
15 services.websites.env.production.modules = [ "proxy_fcgi" ];
16 system.activationScripts.evariste = {
19 install -m 0755 -o wwwrun -g wwwrun -d /var/lib/php/sessions/nsievariste
20 install -m 0755 -o wwwrun -g wwwrun -d /var/lib/php/sessions/stmgevariste
23 services.phpfpm.pools.nsievariste = {
24 listen = "/run/phpfpm/nsievariste.sock";
33 pm.process_idle_timeout = 60
35 php_admin_value[open_basedir] = "/var/lib/php/sessions/nsievariste:${nsiVarDir}:/tmp"
36 php_admin_value[session.save_path] = "/var/lib/php/sessions/nsievariste"
39 services.websites.env.production.vhostConfs.nsievariste = {
42 hosts = ["nsievariste.immae.eu" ];
46 Use Stats nsievariste.immae.eu
49 SetHandler "proxy:unix:/run/phpfpm/nsievariste.sock|fcgi://localhost"
52 <Directory ${nsiVarDir}>
53 DirectoryIndex index.php index.htm index.html
54 Options Indexes FollowSymLinks MultiViews Includes
62 services.phpfpm.pools.stmgevariste = {
63 listen = "/run/phpfpm/stmgevariste.sock";
72 pm.process_idle_timeout = 60
74 php_admin_value[open_basedir] = "/var/lib/php/sessions/stmgevariste:${stmgVarDir}:/tmp"
75 php_admin_value[session.save_path] = "/var/lib/php/sessions/stmgevariste"
78 services.websites.env.production.vhostConfs.stmgevariste = {
81 hosts = ["stmgevariste.immae.eu" ];
85 Use Stats stmgevariste.immae.eu
88 SetHandler "proxy:unix:/run/phpfpm/stmgevariste.sock|fcgi://localhost"
91 <Directory ${stmgVarDir}>
92 DirectoryIndex index.php index.htm index.html
93 Options Indexes FollowSymLinks MultiViews Includes