--- /dev/null
+{ lib, pkgs, config, myconfig, ... }:
+let
+ mantisbt = pkgs.callPackage ./mantisbt.nix {
+ inherit (pkgs.webapps) mantisbt_2 mantisbt_2-plugins;
+ env = myconfig.env.tools.mantisbt;
+ };
+ gitweb = pkgs.callPackage ./gitweb.nix { gitoliteDir = config.services.myGitolite.gitoliteDir; };
+
+ cfg = config.myServices.websites.tools.git;
+in {
+ options.myServices.websites.tools.git = {
+ enable = lib.mkEnableOption "enable git's website";
+ };
+
+ config = lib.mkIf cfg.enable {
+ secrets.keys = mantisbt.keys;
+ services.websites.tools.modules =
+ gitweb.apache.modules ++
+ mantisbt.apache.modules;
+ myServices.websites.webappDirs."${gitweb.apache.webappName}" = gitweb.webRoot;
+ myServices.websites.webappDirs."${mantisbt.apache.webappName}" = mantisbt.webRoot;
+
+ system.activationScripts.mantisbt = mantisbt.activationScript;
+ services.websites.tools.vhostConfs.git = {
+ certName = "eldiron";
+ addToCerts = true;
+ hosts = ["git.immae.eu" ];
+ root = gitweb.apache.root;
+ extraConfig = [
+ gitweb.apache.vhostConf
+ mantisbt.apache.vhostConf
+ ''
+ RewriteEngine on
+ RewriteCond %{REQUEST_URI} ^/releases
+ RewriteRule /releases(.*) https://release.immae.eu$1 [P,L]
+ ''
+ ];
+ };
+ services.phpfpm.poolConfigs = {
+ mantisbt = mantisbt.phpFpm.pool;
+ };
+ };
+}