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