X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=virtual%2Fpackages%2Fgitweb.nix;h=1c2430a59d553f0a5c3542a42491e3bbb409830a;hb=5c101474d350289370105c99bbf65f8bb3a4ef39;hp=437a11a31cf5661a4e19001b6a2c6fef42223cbf;hpb=91493dc0e93b89a24617738ca466e12957143eb0;p=perso%2FImmae%2FConfig%2FNix.git 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 @@ -with import ../../libs.nix; -with nixpkgs_unstable; -let - gitweb = rec { - varDir = "/var/lib/gitolite"; - webRoot = pkgs.gitweb.overrideAttrs(old: { - installPhase = old.installPhase + '' - cp -r ${./gitweb} $out/gitweb-theme; - ''; - }); - config = pkgs.writeText "gitweb.conf" '' - $git_temp = "/tmp"; +{ gitweb, writeText, gitolite, git }: +rec { + varDir = "/var/lib/gitolite"; + webRoot = gitweb; + config = writeText "gitweb.conf" '' + $git_temp = "/tmp"; - # The directories where your projects are. Must not end with a - # slash. - $projectroot = "${varDir}/repositories"; + # The directories where your projects are. Must not end with a + # slash. + $projectroot = "${varDir}/repositories"; - $projects_list = "${varDir}/projects.list"; - $strict_export = "true"; + $projects_list = "${varDir}/projects.list"; + $strict_export = "true"; - # Base URLs for links displayed in the web interface. - our @git_base_url_list = qw(ssh://gitolite@git.immae.eu https://git.immae.eu); + # Base URLs for links displayed in the web interface. + our @git_base_url_list = qw(ssh://gitolite@git.immae.eu https://git.immae.eu); - $feature{'blame'}{'default'} = [1]; - $feature{'avatar'}{'default'} = ['gravatar']; - $feature{'highlight'}{'default'} = [1]; + $feature{'blame'}{'default'} = [1]; + $feature{'avatar'}{'default'} = ['gravatar']; + $feature{'highlight'}{'default'} = [1]; - @stylesheets = ("gitweb-theme/gitweb.css"); - $logo = "gitweb-theme/git-logo.png"; - $favicon = "gitweb-theme/git-favicon.png"; - $javascript = "gitweb-theme/gitweb.js"; - $logo_url = "https://git.immae.eu/"; - $projects_list_group_categories = "true"; - $projects_list_description_width = 60; - $project_list_default_category = "__Others__"; - ''; - apache = { - user = "wwwrun"; - group = "wwwrun"; - modules = [ "cgid" ]; - vhostConf = '' - SetEnv GIT_PROJECT_ROOT ${varDir}/repositories/ - ScriptAliasMatch \ - "(?x)^/(.*/(HEAD | \ - info/refs | \ - objects/(info/[^/]+ | \ - [0-9a-f]{2}/[0-9a-f]{38} | \ - pack/pack-[0-9a-f]{40}\.(pack|idx)) | \ - git-(upload|receive)-pack))$" \ - ${pkgs.git}/libexec/git-core/git-http-backend/$1 + @stylesheets = ("gitweb-theme/gitweb.css"); + $logo = "gitweb-theme/git-logo.png"; + $favicon = "gitweb-theme/git-favicon.png"; + $javascript = "gitweb-theme/gitweb.js"; + $logo_url = "https://git.immae.eu/"; + $projects_list_group_categories = "true"; + $projects_list_description_width = 60; + $project_list_default_category = "__Others__"; + ''; + apache = { + user = "wwwrun"; + group = "wwwrun"; + modules = [ "cgid" ]; + vhostConf = '' + SetEnv GIT_PROJECT_ROOT ${varDir}/repositories/ + ScriptAliasMatch \ + "(?x)^/(.*/(HEAD | \ + info/refs | \ + objects/(info/[^/]+ | \ + [0-9a-f]{2}/[0-9a-f]{38} | \ + pack/pack-[0-9a-f]{40}\.(pack|idx)) | \ + git-(upload|receive)-pack))$" \ + ${git}/libexec/git-core/git-http-backend/$1 - - Require all granted - - - Require all granted - - - DirectoryIndex gitweb.cgi - Require all granted - AllowOverride None - Options ExecCGI FollowSymLinks - - SetHandler cgi-script - SetEnv GITWEB_CONFIG "${config}" - - - ''; + + Require all granted + + + Require all granted + + + DirectoryIndex gitweb.cgi + Require all granted + AllowOverride None + Options ExecCGI FollowSymLinks + + SetHandler cgi-script + SetEnv GITWEB_CONFIG "${config}" + + + ''; }; -}; -in - gitweb +}