]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - modules/private/websites/tools/git/default.nix
Move websites/tools to modules
[perso/Immae/Config/Nix.git] / modules / private / websites / tools / git / default.nix
CommitLineData
8a964143 1{ lib, pkgs, config, myconfig, ... }:
10889174 2let
43dac87f 3 mantisbt = pkgs.callPackage ./mantisbt.nix {
43dac87f 4 inherit (pkgs.webapps) mantisbt_2 mantisbt_2-plugins;
9d90e7e2
IB
5 env = myconfig.env.tools.mantisbt;
6 };
43dac87f 7 gitweb = pkgs.callPackage ./gitweb.nix { gitoliteDir = config.services.myGitolite.gitoliteDir; };
10889174 8
4288c2f2 9 cfg = config.myServices.websites.tools.git;
10889174 10in {
4288c2f2 11 options.myServices.websites.tools.git = {
10889174
IB
12 enable = lib.mkEnableOption "enable git's website";
13 };
14
15 config = lib.mkIf cfg.enable {
1a718805 16 secrets.keys = mantisbt.keys;
daf64e3f 17 services.websites.tools.modules =
10889174
IB
18 gitweb.apache.modules ++
19 mantisbt.apache.modules;
4288c2f2
IB
20 myServices.websites.webappDirs."${gitweb.apache.webappName}" = gitweb.webRoot;
21 myServices.websites.webappDirs."${mantisbt.apache.webappName}" = mantisbt.webRoot;
10889174 22
4288c2f2 23 system.activationScripts.mantisbt = mantisbt.activationScript;
daf64e3f 24 services.websites.tools.vhostConfs.git = {
10889174 25 certName = "eldiron";
7df420c2 26 addToCerts = true;
10889174 27 hosts = ["git.immae.eu" ];
a95ab089 28 root = gitweb.apache.root;
10889174
IB
29 extraConfig = [
30 gitweb.apache.vhostConf
31 mantisbt.apache.vhostConf
32 ''
33 RewriteEngine on
34 RewriteCond %{REQUEST_URI} ^/releases
35 RewriteRule /releases(.*) https://release.immae.eu$1 [P,L]
36 ''
37 ];
38 };
f40f5b23 39 services.phpfpm.poolConfigs = {
10889174
IB
40 mantisbt = mantisbt.phpFpm.pool;
41 };
42 };
43}