diff options
Diffstat (limited to 'virtual/modules/websites/tools/git/default.nix')
-rw-r--r-- | virtual/modules/websites/tools/git/default.nix | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/virtual/modules/websites/tools/git/default.nix b/virtual/modules/websites/tools/git/default.nix new file mode 100644 index 0000000..0a63013 --- /dev/null +++ b/virtual/modules/websites/tools/git/default.nix | |||
@@ -0,0 +1,46 @@ | |||
1 | { lib, pkgs, config, mylibs, ... }: | ||
2 | let | ||
3 | mantisbt = pkgs.callPackage ./mantisbt/mantisbt.nix { inherit (mylibs) checkEnv fetchedGithub; }; | ||
4 | gitweb = pkgs.callPackage ./gitweb/gitweb.nix { gitoliteDir = config.services.myGitolite.gitoliteDir; }; | ||
5 | |||
6 | cfg = config.services.myWebsites.tools.git; | ||
7 | in { | ||
8 | options.services.myWebsites.tools.git = { | ||
9 | enable = lib.mkEnableOption "enable git's website"; | ||
10 | }; | ||
11 | |||
12 | config = lib.mkIf cfg.enable { | ||
13 | # FIXME: include it in vhostConf ? | ||
14 | security.acme.certs."eldiron".extraDomains."git.immae.eu" = null; | ||
15 | |||
16 | nixpkgs.config.packageOverrides = oldpkgs: rec { | ||
17 | gitweb = oldpkgs.gitweb.overrideAttrs(old: { | ||
18 | installPhase = old.installPhase + '' | ||
19 | cp -r ${./gitweb/theme} $out/gitweb-theme; | ||
20 | ''; | ||
21 | }); | ||
22 | }; | ||
23 | |||
24 | services.myWebsites.tools.modules = | ||
25 | gitweb.apache.modules ++ | ||
26 | mantisbt.apache.modules; | ||
27 | |||
28 | services.myWebsites.tools.vhostConfs.git = { | ||
29 | certName = "eldiron"; | ||
30 | hosts = ["git.immae.eu" ]; | ||
31 | root = gitweb.webRoot; | ||
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 | } | ||