- services.websitesWebappDirs = attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair
- icfg.webappName icfg.webRoot
- ) (attrsets.filterAttrs (n: v: !isNull v.webappName && !isNull v.webRoot) cfg);
+ 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.phpOpenbasedir)}"
+ '' + icfg.phpPool;
+ phpOptions = config.services.phpfpm.phpOptions + icfg.phpOptions;
+ }
+ ) cfg.apps;
+
+ services.websites.webappDirs = attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair
+ (if icfg.webappName == null then name else icfg.webappName) icfg.webRoot
+ ) (attrsets.filterAttrs (n: v: !isNull v.webRoot) cfg.apps);