]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - nixops/modules/websites/tools/git/gitweb/gitweb.nix
Rename virtual folder to nixops
[perso/Immae/Config/Nix.git] / nixops / modules / websites / tools / git / gitweb / gitweb.nix
CommitLineData
e570c4f5 1{ gitweb, writeText, gitolite, git, gitoliteDir, highlight }:
5c101474 2rec {
950ca5ee 3 varDir = gitoliteDir;
5c101474
IB
4 webRoot = gitweb;
5 config = writeText "gitweb.conf" ''
6 $git_temp = "/tmp";
cf80b4f2 7
5c101474
IB
8 # The directories where your projects are. Must not end with a
9 # slash.
10 $projectroot = "${varDir}/repositories";
cf80b4f2 11
5c101474
IB
12 $projects_list = "${varDir}/projects.list";
13 $strict_export = "true";
cf80b4f2 14
5c101474
IB
15 # Base URLs for links displayed in the web interface.
16 our @git_base_url_list = qw(ssh://gitolite@git.immae.eu https://git.immae.eu);
cf80b4f2 17
5c101474
IB
18 $feature{'blame'}{'default'} = [1];
19 $feature{'avatar'}{'default'} = ['gravatar'];
20 $feature{'highlight'}{'default'} = [1];
cf80b4f2 21
5c101474
IB
22 @stylesheets = ("gitweb-theme/gitweb.css");
23 $logo = "gitweb-theme/git-logo.png";
24 $favicon = "gitweb-theme/git-favicon.png";
25 $javascript = "gitweb-theme/gitweb.js";
26 $logo_url = "https://git.immae.eu/";
27 $projects_list_group_categories = "true";
28 $projects_list_description_width = 60;
29 $project_list_default_category = "__Others__";
e570c4f5 30 $highlight_bin = "${highlight}/bin/highlight";
5c101474
IB
31 '';
32 apache = {
33 user = "wwwrun";
34 group = "wwwrun";
35 modules = [ "cgid" ];
36 vhostConf = ''
37 SetEnv GIT_PROJECT_ROOT ${varDir}/repositories/
38 ScriptAliasMatch \
39 "(?x)^/(.*/(HEAD | \
40 info/refs | \
41 objects/(info/[^/]+ | \
42 [0-9a-f]{2}/[0-9a-f]{38} | \
43 pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
44 git-(upload|receive)-pack))$" \
45 ${git}/libexec/git-core/git-http-backend/$1
cf80b4f2 46
5c101474
IB
47 <Directory "${gitolite}">
48 Require all granted
49 </Directory>
50 <Directory "${git}/libexec/git-core">
51 Require all granted
52 </Directory>
53 <Directory "${webRoot}">
54 DirectoryIndex gitweb.cgi
55 Require all granted
56 AllowOverride None
57 Options ExecCGI FollowSymLinks
58 <Files gitweb.cgi>
59 SetHandler cgi-script
60 SetEnv GITWEB_CONFIG "${config}"
61 </Files>
62 </Directory>
63 '';
cf80b4f2 64 };
5c101474 65}