From 5400b9b6f65451d41a9106fae6fc00f97d83f4ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Wed, 25 Mar 2020 11:57:48 +0100 Subject: Upgrade nixos --- modules/websites/php-application.nix | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'modules/websites/php-application.nix') diff --git a/modules/websites/php-application.nix b/modules/websites/php-application.nix index 8ad7a0d..20e2a5d 100644 --- a/modules/websites/php-application.nix +++ b/modules/websites/php-application.nix @@ -44,10 +44,15 @@ in description = "Name of the socket to listen to. Defaults to app name if null"; }; phpPool = mkOption { - type = lines; - default = ""; + type = attrsOf str; + default = {}; description = "Pool configuration to append"; }; + phpEnv = mkOption { + type = attrsOf str; + default = {}; + description = "Pool environment to append"; + }; phpOptions = mkOption { type = lines; default = ""; @@ -135,7 +140,7 @@ in services.phpApplication.phpListenPaths = mkOption { type = attrsOf path; default = attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair - name "/run/phpfpm/${if icfg.phpListen == null then name else icfg.phpListen}.sock" + name config.services.phpfpm.pools."${name}".socket ) cfg.apps; readOnly = true; description = '' @@ -162,17 +167,17 @@ in services.phpfpm.pools = attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair name { - listen = cfg.phpListenPaths."${name}"; - extraConfig = '' - user = ${icfg.httpdUser} - group = ${icfg.httpdGroup} - listen.owner = ${icfg.httpdUser} - listen.group = ${icfg.httpdGroup} - ${optionalString (icfg.phpSession) '' - php_admin_value[session.save_path] = "${icfg.varDir}/phpSessions"''} - php_admin_value[open_basedir] = "${builtins.concatStringsSep ":" ([icfg.app icfg.varDir] ++ icfg.phpWatchFiles ++ icfg.phpOpenbasedir)}" - '' + icfg.phpPool; + user = icfg.httpdUser; + group = icfg.httpdUser; + settings = { + "listen.owner" = icfg.httpdUser; + "listen.group" = icfg.httpdGroup; + "php_admin_value[open_basedir]" = builtins.concatStringsSep ":" ([icfg.app icfg.varDir] ++ icfg.phpWatchFiles ++ icfg.phpOpenbasedir); + } + // optionalAttrs (icfg.phpSession) { "php_admin_value[session.save_path]" = "${icfg.varDir}/phpSessions"; } + // icfg.phpPool; phpOptions = config.services.phpfpm.phpOptions + icfg.phpOptions; + inherit (icfg) phpEnv; } ) cfg.apps; -- cgit v1.2.3