X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=virtual%2Fpackages%2Fmantisbt.nix;fp=virtual%2Fpackages%2Fmantisbt.nix;h=f136ea53bbd5f11af168b8577b9b48a7371e749b;hb=50d8fa14e0a4300960b3e5648349777e1e3ddecc;hp=0000000000000000000000000000000000000000;hpb=7611e4e2ace4355ec4397a675883890927a13c7c;p=perso%2FImmae%2FConfig%2FNix.git 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