]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/tools/git/default.nix
Use pools instead of deprecated poolConfigs for php
[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 };
7 gitweb = pkgs.callPackage ./gitweb.nix {
8 gitoliteDir = config.myServices.gitolite.gitoliteDir;
9 };
10
11 cfg = config.myServices.websites.tools.git;
12 in {
13 options.myServices.websites.tools.git = {
14 enable = lib.mkEnableOption "enable git's website";
15 };
16
17 config = lib.mkIf cfg.enable {
18 secrets.keys = mantisbt.keys;
19 services.websites.env.tools.modules =
20 gitweb.apache.modules ++
21 mantisbt.apache.modules;
22 myServices.websites.webappDirs."${gitweb.apache.webappName}" = gitweb.webRoot;
23 myServices.websites.webappDirs."${mantisbt.apache.webappName}" = mantisbt.webRoot;
24
25 system.activationScripts.mantisbt = mantisbt.activationScript;
26 services.websites.env.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.phpfpm.pools = {
42 mantisbt = {
43 listen = mantisbt.phpFpm.socket;
44 extraConfig = mantisbt.phpFpm.pool;
45 };
46 };
47 };
48 }