{ lib, env, writeText, stdenv, fetchurl, fetchedGithub }: let mantisbt = let plugins = { slack = stdenv.mkDerivation (fetchedGithub ./mantisbt-plugin-slack.json // rec { installPhase = '' sed -i -e "s/return '@' . \\\$username;/return \\\$username;/" Slack.php cp -a . $out ''; }); source-integration = stdenv.mkDerivation (fetchedGithub ./mantisbt-plugin-source-integration.json // rec { installPhase = '' mkdir $out patch -p1 < ${./mantisbt-plugin-source-integration_Source.API.php.diff} cp -a Source* $out/ ''; }); }; in rec { keys."tools-mantisbt" = { destDir = "/run/keys/webapps"; user = apache.user; group = apache.group; permissions = "0400"; text = '' DirectoryIndex index.php SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" AllowOverride All Options FollowSymlinks Require all granted #Reenable during upgrade Require all denied ''; }; phpFpm = rec { serviceDeps = [ "postgresql.service" "openldap.service" "tools-mantisbt-key.service" ]; basedir = builtins.concatStringsSep ":" ( [ webRoot "/run/keys/webapps/tools-mantisbt" ] ++ lib.attrsets.mapAttrsToList (name: value: value) plugins); socket = "/var/run/phpfpm/mantisbt.sock"; pool = '' listen = ${socket} user = ${apache.user} group = ${apache.group} listen.owner = ${apache.user} listen.group = ${apache.group} pm = ondemand pm.max_children = 60 pm.process_idle_timeout = 60 php_admin_value[upload_max_filesize] = 5000000 php_admin_value[open_basedir] = "${basedir}:/tmp:/var/lib/php/sessions/mantisbt" php_admin_value[session.save_path] = "/var/lib/php/sessions/mantisbt" ''; }; }; in mantisbt