]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - nixops/modules/websites/tools/git/default.nix
Move secrets module outside of nixops
[perso/Immae/Config/Nix.git] / nixops / modules / websites / tools / git / default.nix
1 { lib, pkgs, config, myconfig, mylibs, ... }:
2 let
3 mantisbt = pkgs.callPackage ./mantisbt.nix {
4 inherit (mylibs) fetchedGithub;
5 inherit (pkgs.webapps) mantisbt_2 mantisbt_2-plugins;
6 env = myconfig.env.tools.mantisbt;
7 };
8 gitweb = pkgs.callPackage ./gitweb.nix { gitoliteDir = config.services.myGitolite.gitoliteDir; };
9
10 cfg = config.services.myWebsites.tools.git;
11 in {
12 options.services.myWebsites.tools.git = {
13 enable = lib.mkEnableOption "enable git's website";
14 };
15
16 config = lib.mkIf cfg.enable {
17 security.acme.certs."eldiron".extraDomains."git.immae.eu" = null;
18
19 secrets.keys = mantisbt.keys;
20 services.myWebsites.tools.modules =
21 gitweb.apache.modules ++
22 mantisbt.apache.modules;
23 system.extraSystemBuilderCmds = ''
24 mkdir -p $out/webapps
25 ln -s ${gitweb.webRoot} $out/webapps/${gitweb.apache.webappName}
26 ln -s ${mantisbt.webRoot} $out/webapps/${mantisbt.apache.webappName}
27 '';
28
29 services.myWebsites.tools.vhostConfs.git = {
30 certName = "eldiron";
31 hosts = ["git.immae.eu" ];
32 root = gitweb.apache.root;
33 extraConfig = [
34 gitweb.apache.vhostConf
35 mantisbt.apache.vhostConf
36 ''
37 RewriteEngine on
38 RewriteCond %{REQUEST_URI} ^/releases
39 RewriteRule /releases(.*) https://release.immae.eu$1 [P,L]
40 ''
41 ];
42 };
43 services.myPhpfpm.poolConfigs = {
44 mantisbt = mantisbt.phpFpm.pool;
45 };
46 };
47 }