diff options
Diffstat (limited to 'modules/private/websites/tools/git/default.nix')
-rw-r--r-- | modules/private/websites/tools/git/default.nix | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/modules/private/websites/tools/git/default.nix b/modules/private/websites/tools/git/default.nix new file mode 100644 index 00000000..75d02402 --- /dev/null +++ b/modules/private/websites/tools/git/default.nix | |||
@@ -0,0 +1,45 @@ | |||
1 | { lib, pkgs, config, myconfig, ... }: | ||
2 | let | ||
3 | mantisbt = pkgs.callPackage ./mantisbt.nix { | ||
4 | inherit (pkgs.webapps) mantisbt_2 mantisbt_2-plugins; | ||
5 | env = myconfig.env.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.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.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.poolConfigs = { | ||
42 | mantisbt = mantisbt.phpFpm.pool; | ||
43 | }; | ||
44 | }; | ||
45 | } | ||