2020-06-14 23:35:18 +00:00
|
|
|
{ config, lib, pkgs, ...}@args:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.services.php52-fpm;
|
|
|
|
php52 = import ./default.nix args;
|
|
|
|
in {
|
|
|
|
options.services.php52-fpm = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
If enabled, NixOS will start a PHP 5.2 FastCGI daemon in the background.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
|
|
|
systemd.services.php52-fpm = mkIf cfg.enable {
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
before = [ "nginx.service" ];
|
|
|
|
environment = {
|
|
|
|
PHP_FCGI_CHILDREN = "4";
|
|
|
|
PHP_FCGI_MAX_REQUESTS = "5000";
|
|
|
|
};
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "forking";
|
|
|
|
PIDFile = "/run/php52-fpm/php-fpm.pid";
|
|
|
|
ExecStart = "${php52}/bin/php-cgi -x";
|
|
|
|
User = "nginx";
|
|
|
|
Group = "nginx";
|
|
|
|
RuntimeDirectory = "php52-fpm";
|
|
|
|
LogsDirectory = "php52-fpm";
|
2021-11-12 02:04:41 +00:00
|
|
|
Restart = "always";
|
2020-06-14 23:35:18 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|