more on redmine
[sourcephile-nix.git] / install / logical / friot / nginx / gitweb.nix
index c8eb85038d266c1ccca9a26b25ed99d0c50ef0ef..f0957797bab9ac1a0a3c62703d1e9593943b07ce 100644 (file)
@@ -1,24 +1,34 @@
 {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;
@@ -28,6 +38,12 @@ in
               fastcgi_pass unix:${gitwebSocket};
             '';
           };
+          "/static/" = {
+            alias = "${pkgs.gitweb}/static/";
+          };
+          "/static-custom/" = {
+            alias = "${static-custom}/static-custom/";
+          };
         };
       };
     };
@@ -52,7 +68,9 @@ in
       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";
@@ -60,12 +78,14 @@ in
         $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";