diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-01-12 01:15:55 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-01-12 01:15:55 +0100 |
commit | 985845405f0ddd6531e4392e899a31179cde70d6 (patch) | |
tree | 393dcb6f389622fef74926d25158653ea4d9be6d /virtual/eldiron.nix | |
parent | f3d9c61e9becccc9ef25f64e5e639d45ea25650a (diff) | |
download | Nix-985845405f0ddd6531e4392e899a31179cde70d6.tar.gz Nix-985845405f0ddd6531e4392e899a31179cde70d6.tar.zst Nix-985845405f0ddd6531e4392e899a31179cde70d6.zip |
Refactor a bit the php-fpm module
This commit adds a new phpfpm service with a new option that permits to
specify pool-specific php configuration (caveat: now each pool has
distinct php ini file, even if they have the same content)
Make sure that the same php package is used everywhere
Build pdo_mysql using mysql c-connector. Would be good to have the same
with mysqli but it seems not to work
Diffstat (limited to 'virtual/eldiron.nix')
-rw-r--r-- | virtual/eldiron.nix | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/virtual/eldiron.nix b/virtual/eldiron.nix index 2e4ae12..c9075cf 100644 --- a/virtual/eldiron.nix +++ b/virtual/eldiron.nix | |||
@@ -32,6 +32,7 @@ | |||
32 | ./modules/gitweb.nix | 32 | ./modules/gitweb.nix |
33 | ./modules/databases.nix | 33 | ./modules/databases.nix |
34 | ./modules/websites | 34 | ./modules/websites |
35 | ./modules/websites/phpfpm | ||
35 | ]; | 36 | ]; |
36 | services.myGitolite.enable = true; | 37 | services.myGitolite.enable = true; |
37 | services.myGitweb.enable = true; | 38 | services.myGitweb.enable = true; |
@@ -73,8 +74,8 @@ | |||
73 | cd ${mypkgs.nextcloud.webRoot} | 74 | cd ${mypkgs.nextcloud.webRoot} |
74 | NEXTCLOUD_CONFIG_DIR="${mypkgs.nextcloud.webRoot}/config" \ | 75 | NEXTCLOUD_CONFIG_DIR="${mypkgs.nextcloud.webRoot}/config" \ |
75 | exec \ | 76 | exec \ |
76 | ${config.services.phpfpm.phpPackage}/bin/php \ | 77 | ${pkgs.php}/bin/php \ |
77 | -c ${config.services.phpfpm.phpPackage}/etc/php.ini \ | 78 | -c ${pkgs.php}/etc/php.ini \ |
78 | occ $* | 79 | occ $* |
79 | ''; | 80 | ''; |
80 | in [ | 81 | in [ |
@@ -98,23 +99,19 @@ | |||
98 | 99 | ||
99 | services.ympd = mypkgs.ympd.config // { enable = false; }; | 100 | services.ympd = mypkgs.ympd.config // { enable = false; }; |
100 | 101 | ||
101 | services.phpfpm = { | 102 | services.myPhpfpm = { |
102 | # FIXME: move session files to separate dirs | 103 | phpPackage = pkgs.php; |
103 | # /!\ phppackage is used in nextcloud configuation | ||
104 | phpOptions = '' | 104 | phpOptions = '' |
105 | session.save_path = "/var/lib/php/sessions" | 105 | session.save_path = "/var/lib/php/sessions" |
106 | session.gc_maxlifetime = 60*60*24*15 | 106 | session.gc_maxlifetime = 60*60*24*15 |
107 | session.cache_expire = 60*24*30 | 107 | session.cache_expire = 60*24*30 |
108 | ; For nextcloud | ||
109 | extension=${pkgs.phpPackages.redis}/lib/php/extensions/redis.so | ||
110 | ; For nextcloud | ||
111 | extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so | ||
112 | ; For nextcloud | ||
113 | zend_extension=${pkgs.php}/lib/php/extensions/opcache.so | ||
114 | ''; | 108 | ''; |
115 | extraConfig = '' | 109 | extraConfig = '' |
116 | log_level = notice | 110 | log_level = notice |
117 | ''; | 111 | ''; |
112 | poolPhpConfigs = { | ||
113 | nextcloud = mypkgs.nextcloud.phpFpm.phpConfig; | ||
114 | }; | ||
118 | poolConfigs = { | 115 | poolConfigs = { |
119 | adminer = mypkgs.adminer.phpFpm.pool; | 116 | adminer = mypkgs.adminer.phpFpm.pool; |
120 | nextcloud = mypkgs.nextcloud.phpFpm.pool; | 117 | nextcloud = mypkgs.nextcloud.phpFpm.pool; |