From 4288c2f2431fb782b0d512b1b3749187f2374b6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Wed, 22 May 2019 20:01:33 +0200 Subject: Move websites/tools to modules --- modules/private/websites/tools/git/default.nix | 43 ++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 modules/private/websites/tools/git/default.nix (limited to 'modules/private/websites/tools/git/default.nix') diff --git a/modules/private/websites/tools/git/default.nix b/modules/private/websites/tools/git/default.nix new file mode 100644 index 0000000..3e8b605 --- /dev/null +++ b/modules/private/websites/tools/git/default.nix @@ -0,0 +1,43 @@ +{ lib, pkgs, config, myconfig, ... }: +let + mantisbt = pkgs.callPackage ./mantisbt.nix { + inherit (pkgs.webapps) mantisbt_2 mantisbt_2-plugins; + env = myconfig.env.tools.mantisbt; + }; + gitweb = pkgs.callPackage ./gitweb.nix { gitoliteDir = config.services.myGitolite.gitoliteDir; }; + + cfg = config.myServices.websites.tools.git; +in { + options.myServices.websites.tools.git = { + enable = lib.mkEnableOption "enable git's website"; + }; + + config = lib.mkIf cfg.enable { + secrets.keys = mantisbt.keys; + services.websites.tools.modules = + gitweb.apache.modules ++ + mantisbt.apache.modules; + myServices.websites.webappDirs."${gitweb.apache.webappName}" = gitweb.webRoot; + myServices.websites.webappDirs."${mantisbt.apache.webappName}" = mantisbt.webRoot; + + system.activationScripts.mantisbt = mantisbt.activationScript; + services.websites.tools.vhostConfs.git = { + certName = "eldiron"; + addToCerts = true; + hosts = ["git.immae.eu" ]; + root = gitweb.apache.root; + extraConfig = [ + gitweb.apache.vhostConf + mantisbt.apache.vhostConf + '' + RewriteEngine on + RewriteCond %{REQUEST_URI} ^/releases + RewriteRule /releases(.*) https://release.immae.eu$1 [P,L] + '' + ]; + }; + services.phpfpm.poolConfigs = { + mantisbt = mantisbt.phpFpm.pool; + }; + }; +} -- cgit v1.2.3