]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/tools/git/default.nix
Add config for CI
[perso/Immae/Config/Nix.git] / modules / private / websites / tools / git / default.nix
1 { lib, pkgs, config, ... }:
2 let
3 mantisbt = pkgs.callPackage ./mantisbt.nix {
4 inherit (pkgs.webapps) mantisbt_2 mantisbt_2-plugins;
5 env = config.myEnv.tools.mantisbt;
6 inherit config;
7 };
8 gitweb = pkgs.callPackage ./gitweb.nix {
9 gitoliteDir = config.myServices.gitolite.gitoliteDir;
10 };
11
12 cfg = config.myServices.websites.tools.git;
13 in {
14 options.myServices.websites.tools.git = {
15 enable = lib.mkEnableOption "enable git's website";
16 };
17
18 config = lib.mkIf cfg.enable {
19 secrets.keys = mantisbt.keys;
20 services.websites.env.tools.modules =
21 gitweb.apache.modules ++
22 mantisbt.apache.modules;
23
24 system.activationScripts.mantisbt = mantisbt.activationScript;
25 services.websites.env.tools.vhostConfs.git = {
26 certName = "eldiron";
27 addToCerts = true;
28 hosts = ["git.immae.eu" ];
29 root = gitweb.apache.root;
30 extraConfig = [
31 gitweb.apache.vhostConf
32 (mantisbt.apache.vhostConf config.services.phpfpm.pools.mantisbt.socket)
33 ''
34 RewriteEngine on
35 RewriteCond %{REQUEST_URI} ^/releases
36 RewriteRule /releases(.*) https://release.immae.eu$1 [P,L]
37 ''
38 ];
39 };
40 services.phpfpm.pools = {
41 mantisbt = {
42 user = config.services.httpd.Tools.user;
43 group = config.services.httpd.Tools.group;
44 settings = mantisbt.phpFpm.pool;
45 phpPackage = pkgs.php72;
46 };
47 };
48 };
49 }