aboutsummaryrefslogtreecommitdiff
path: root/virtual/packages/gitweb.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-01-04 17:02:27 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-01-04 17:03:19 +0100
commit5c101474d350289370105c99bbf65f8bb3a4ef39 (patch)
treed33295494241843f28ae9014033828512519acc3 /virtual/packages/gitweb.nix
parent91493dc0e93b89a24617738ca466e12957143eb0 (diff)
downloadNix-5c101474d350289370105c99bbf65f8bb3a4ef39.tar.gz
Nix-5c101474d350289370105c99bbf65f8bb3a4ef39.tar.zst
Nix-5c101474d350289370105c99bbf65f8bb3a4ef39.zip
Bubble up the imports to the main file
Diffstat (limited to 'virtual/packages/gitweb.nix')
-rw-r--r--virtual/packages/gitweb.nix122
1 files changed, 57 insertions, 65 deletions
diff --git a/virtual/packages/gitweb.nix b/virtual/packages/gitweb.nix
index 437a11a..1c2430a 100644
--- a/virtual/packages/gitweb.nix
+++ b/virtual/packages/gitweb.nix
@@ -1,72 +1,64 @@
1with import ../../libs.nix; 1{ gitweb, writeText, gitolite, git }:
2with nixpkgs_unstable; 2rec {
3let 3 varDir = "/var/lib/gitolite";
4 gitweb = rec { 4 webRoot = gitweb;
5 varDir = "/var/lib/gitolite"; 5 config = writeText "gitweb.conf" ''
6 webRoot = pkgs.gitweb.overrideAttrs(old: { 6 $git_temp = "/tmp";
7 installPhase = old.installPhase + ''
8 cp -r ${./gitweb} $out/gitweb-theme;
9 '';
10 });
11 config = pkgs.writeText "gitweb.conf" ''
12 $git_temp = "/tmp";
13 7
14 # The directories where your projects are. Must not end with a 8 # The directories where your projects are. Must not end with a
15 # slash. 9 # slash.
16 $projectroot = "${varDir}/repositories"; 10 $projectroot = "${varDir}/repositories";
17 11
18 $projects_list = "${varDir}/projects.list"; 12 $projects_list = "${varDir}/projects.list";
19 $strict_export = "true"; 13 $strict_export = "true";
20 14
21 # Base URLs for links displayed in the web interface. 15 # Base URLs for links displayed in the web interface.
22 our @git_base_url_list = qw(ssh://gitolite@git.immae.eu https://git.immae.eu); 16 our @git_base_url_list = qw(ssh://gitolite@git.immae.eu https://git.immae.eu);
23 17
24 $feature{'blame'}{'default'} = [1]; 18 $feature{'blame'}{'default'} = [1];
25 $feature{'avatar'}{'default'} = ['gravatar']; 19 $feature{'avatar'}{'default'} = ['gravatar'];
26 $feature{'highlight'}{'default'} = [1]; 20 $feature{'highlight'}{'default'} = [1];
27 21
28 @stylesheets = ("gitweb-theme/gitweb.css"); 22 @stylesheets = ("gitweb-theme/gitweb.css");
29 $logo = "gitweb-theme/git-logo.png"; 23 $logo = "gitweb-theme/git-logo.png";
30 $favicon = "gitweb-theme/git-favicon.png"; 24 $favicon = "gitweb-theme/git-favicon.png";
31 $javascript = "gitweb-theme/gitweb.js"; 25 $javascript = "gitweb-theme/gitweb.js";
32 $logo_url = "https://git.immae.eu/"; 26 $logo_url = "https://git.immae.eu/";
33 $projects_list_group_categories = "true"; 27 $projects_list_group_categories = "true";
34 $projects_list_description_width = 60; 28 $projects_list_description_width = 60;
35 $project_list_default_category = "__Others__"; 29 $project_list_default_category = "__Others__";
36 ''; 30 '';
37 apache = { 31 apache = {
38 user = "wwwrun"; 32 user = "wwwrun";
39 group = "wwwrun"; 33 group = "wwwrun";
40 modules = [ "cgid" ]; 34 modules = [ "cgid" ];
41 vhostConf = '' 35 vhostConf = ''
42 SetEnv GIT_PROJECT_ROOT ${varDir}/repositories/ 36 SetEnv GIT_PROJECT_ROOT ${varDir}/repositories/
43 ScriptAliasMatch \ 37 ScriptAliasMatch \
44 "(?x)^/(.*/(HEAD | \ 38 "(?x)^/(.*/(HEAD | \
45 info/refs | \ 39 info/refs | \
46 objects/(info/[^/]+ | \ 40 objects/(info/[^/]+ | \
47 [0-9a-f]{2}/[0-9a-f]{38} | \ 41 [0-9a-f]{2}/[0-9a-f]{38} | \
48 pack/pack-[0-9a-f]{40}\.(pack|idx)) | \ 42 pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
49 git-(upload|receive)-pack))$" \ 43 git-(upload|receive)-pack))$" \
50 ${pkgs.git}/libexec/git-core/git-http-backend/$1 44 ${git}/libexec/git-core/git-http-backend/$1
51 45
52 <Directory "${pkgs.gitolite}"> 46 <Directory "${gitolite}">
53 Require all granted 47 Require all granted
54 </Directory> 48 </Directory>
55 <Directory "${pkgs.git}/libexec/git-core"> 49 <Directory "${git}/libexec/git-core">
56 Require all granted 50 Require all granted
57 </Directory> 51 </Directory>
58 <Directory "${webRoot}"> 52 <Directory "${webRoot}">
59 DirectoryIndex gitweb.cgi 53 DirectoryIndex gitweb.cgi
60 Require all granted 54 Require all granted
61 AllowOverride None 55 AllowOverride None
62 Options ExecCGI FollowSymLinks 56 Options ExecCGI FollowSymLinks
63 <Files gitweb.cgi> 57 <Files gitweb.cgi>
64 SetHandler cgi-script 58 SetHandler cgi-script
65 SetEnv GITWEB_CONFIG "${config}" 59 SetEnv GITWEB_CONFIG "${config}"
66 </Files> 60 </Files>
67 </Directory> 61 </Directory>
68 ''; 62 '';
69 }; 63 };
70}; 64}
71in
72 gitweb