]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - nixops/modules/websites/tools/git/default.nix
Start moving websites configuration to modules
[perso/Immae/Config/Nix.git] / nixops / modules / 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
IB
8
9 cfg = config.services.myWebsites.tools.git;
10in {
11 options.services.myWebsites.tools.git = {
12 enable = lib.mkEnableOption "enable git's website";
13 };
14
15 config = lib.mkIf cfg.enable {
10889174
IB
16 security.acme.certs."eldiron".extraDomains."git.immae.eu" = null;
17
1a718805 18 secrets.keys = mantisbt.keys;
daf64e3f 19 services.websites.tools.modules =
10889174
IB
20 gitweb.apache.modules ++
21 mantisbt.apache.modules;
a95ab089
IB
22 system.extraSystemBuilderCmds = ''
23 mkdir -p $out/webapps
24 ln -s ${gitweb.webRoot} $out/webapps/${gitweb.apache.webappName}
25 ln -s ${mantisbt.webRoot} $out/webapps/${mantisbt.apache.webappName}
26 '';
10889174 27
daf64e3f 28 services.websites.tools.vhostConfs.git = {
10889174
IB
29 certName = "eldiron";
30 hosts = ["git.immae.eu" ];
a95ab089 31 root = gitweb.apache.root;
10889174
IB
32 extraConfig = [
33 gitweb.apache.vhostConf
34 mantisbt.apache.vhostConf
35 ''
36 RewriteEngine on
37 RewriteCond %{REQUEST_URI} ^/releases
38 RewriteRule /releases(.*) https://release.immae.eu$1 [P,L]
39 ''
40 ];
41 };
42 services.myPhpfpm.poolConfigs = {
43 mantisbt = mantisbt.phpFpm.pool;
44 };
45 };
46}