]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - nixops/modules/websites/tools/git/default.nix
064d3ddb50fa92a84cc72fd445b2df1dafaaab76
[perso/Immae/Config/Nix.git] / nixops / modules / websites / tools / git / default.nix
1 { lib, pkgs, config, myconfig, ... }:
2 let
3 mantisbt = pkgs.callPackage ./mantisbt.nix {
4 inherit (pkgs.webapps) mantisbt_2 mantisbt_2-plugins;
5 env = myconfig.env.tools.mantisbt;
6 };
7 gitweb = pkgs.callPackage ./gitweb.nix { gitoliteDir = config.services.myGitolite.gitoliteDir; };
8
9 cfg = config.services.myWebsites.tools.git;
10 in {
11 options.services.myWebsites.tools.git = {
12 enable = lib.mkEnableOption "enable git's website";
13 };
14
15 config = lib.mkIf cfg.enable {
16 secrets.keys = mantisbt.keys;
17 services.websites.tools.modules =
18 gitweb.apache.modules ++
19 mantisbt.apache.modules;
20 system.extraSystemBuilderCmds = ''
21 mkdir -p $out/webapps
22 ln -s ${gitweb.webRoot} $out/webapps/${gitweb.apache.webappName}
23 ln -s ${mantisbt.webRoot} $out/webapps/${mantisbt.apache.webappName}
24 '';
25
26 services.websites.tools.vhostConfs.git = {
27 certName = "eldiron";
28 addToCerts = true;
29 hosts = ["git.immae.eu" ];
30 root = gitweb.apache.root;
31 extraConfig = [
32 gitweb.apache.vhostConf
33 mantisbt.apache.vhostConf
34 ''
35 RewriteEngine on
36 RewriteCond %{REQUEST_URI} ^/releases
37 RewriteRule /releases(.*) https://release.immae.eu$1 [P,L]
38 ''
39 ];
40 };
41 services.myPhpfpm.poolConfigs = {
42 mantisbt = mantisbt.phpFpm.pool;
43 };
44 };
45 }