From 50d8fa14e0a4300960b3e5648349777e1e3ddecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Thu, 3 Jan 2019 16:18:15 +0100 Subject: Add mantisbt --- virtual/packages/mantisbt.nix | 124 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 virtual/packages/mantisbt.nix (limited to 'virtual/packages/mantisbt.nix') diff --git a/virtual/packages/mantisbt.nix b/virtual/packages/mantisbt.nix new file mode 100644 index 0000000..f136ea5 --- /dev/null +++ b/virtual/packages/mantisbt.nix @@ -0,0 +1,124 @@ +with import ../../libs.nix; +with nixpkgs_unstable; +let + # FIXME: check that source-integration and slack still work + 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 { + config = + assert checkEnv "NIXOPS_MANTISBT_DB_PASSWORD"; + assert checkEnv "NIXOPS_MANTISBT_MASTER_SALT"; + assert checkEnv "NIXOPS_MANTISBT_LDAP_PASSWORD"; + pkgs.writeText "config_inc.php" '' + + 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 { + basedir = builtins.concatStringsSep ":" ( + [ webRoot config ] + ++ pkgs.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" + ''; + }; + }; +in + mantisbt -- cgit v1.2.3