{pkgs, lib, config, ...}:
-let inherit (config.services) gitweb gitolite nginx;
+let inherit (config) networking;
+ inherit (config.services) gitweb gitolite nginx;
package = pkgs.gitweb.override (lib.optionalAttrs gitweb.gitwebTheme {
gitwebTheme = true;
});
RuntimeDirectory = "gitweb";
gitwebSocket = "/run/${RuntimeDirectory}/gitweb.sock";
+ static-custom = pkgs.writeTextFile {
+ name = "static-custom";
+ destination = "/static-custom/style.css";
+ text = ''
+ .project_list {
+ width:100%;
+ }
+ '';
+ };
in
{
config = {
services.nginx = {
virtualHosts."git" = {
- serverName = "git.${config.networking.domain}";
+ serverName = "git.${networking.domain}";
+ serverAliases =
+ map (domainAlias: "git." + domainAlias)
+ config.networking.domainAliases;
#listen = [
# { addr = "0.0.0.0"; port = 80; ssl = false; }
#];
#default = true;
locations = {
- "/static/" = {
- alias = "${pkgs.gitweb}/static/";
- };
"/" = {
extraConfig = ''
include ${pkgs.nginx}/conf/fastcgi_params;
fastcgi_pass unix:${gitwebSocket};
'';
};
+ "/static/" = {
+ alias = "${pkgs.gitweb}/static/";
+ };
+ "/static-custom/" = {
+ alias = "${static-custom}/static-custom/";
+ };
};
};
};
projectroot = "${gitolite.dataDir}/repositories";
extraConfig = ''
use utf8;
- $home_link_str = "repos";
+ my $s = $cgi->https() ? "s" : "";
+ @extra_breadcrumbs = (["${networking.domainBase}" => "http''${s}://${networking.domain}"]);
+ $home_link_str = "git";
$projects_list = "${gitolite.dataDir}/projects.list";
$projects_list_group_categories = 1;
$default_projects_order = "age";
$export_ok = "git-daemon-export-ok";
$prevent_xss = 0;
@git_base_url_list =
- ( "git://git.${config.networking.domain}"
- , "git\@git.${config.networking.domain}:"
+ ( "git://git.${networking.domain}"
+ , "git\@git.${networking.domain}:"
);
$feature{'pathinfo'}{'default'} = [1];
# NOTE: more readable URL.
- @stylesheets = ("/static/gitweb.css");
+ @stylesheets = ( "/static/gitweb.css"
+ , "/static-custom/style.css"
+ );
$logo = "/static/git-logo.png";
$favicon = "/static/git-favicon.png";
$javascript = "/static/gitweb.js";