summaryrefslogtreecommitdiff
path: root/depo/nutin-madaj/git.nix
blob: 9fedca0f956bd025158737a8350e24cdf86223d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{ pkgs, ... }:

let
  benKey =  "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCiNB0iF9ClawNEizBtdYucqp1tAXXRbqvlPS6PFRrtiwSl+SJD29BCLgA5rLxcmFhBHZ/iId/En7GPFEzI/gMu071J7pUI4OcW0UVZju3GNc6ZEz/a6AD2u79JiXEDHfPEdmMqAe36kkaK0KJWSQP3xsFRwJ+8F8HHbSwoCLL+GJhBgAWHQLGfKesNrDacNljNDU3CgkEnDmu8QKuSzH2k1vrr69q2u2iMSAdiStDBAWEjN5nCVrm2XB2vmFLMtXpX2n8JI+znOGzRRDc8dNXejQeDMZGyV6jfVidEIX7vdgSydGjTRKcCLVAsKY3z0gYBZ8u8EUNujgcFBnnAvytj ben@neb";
  gitDir = "/srv/git";
in
{
  services = {
    gitolite = {
      enable = true;
      enableGitAnnex = true;
      dataDir = "${gitDir}";
      user = "git";
      group = "git";
      extraGitoliteRc = ''
        $RC{SITE_INFO} = 'a computer is a bicycle for the mind.';
        $RC{GIT_CONFIG_KEYS} = 'gitweb\.(owner|description|category)';
      '';
      adminPubkey = "${benKey}";
    };
    lighttpd = {
      enable = false;
      port = 8000;
      document-root = "/srv/www";
      mod_userdir = true;
      mod_status = true;
      collectd = {
        enable = true;
      };
      cgit = {
        # disable cgit for now; the ssh interface still works anyway.
        enable = false;
        subdir = "git";
        configText = ''
          cache-size=0
          clone-url=git@simatime.com:$CGIT_REPO_URL
          enable-index-owner=1
          enable-http-clone=0
          enable-index-links=1
          enable-commit-graph=1
          enable-log-filecount=1
          enable-log-linecount=1
          enable-git-config=1
          remove-suffix=1
          branch-sort=age
          max-stats=week
          mimetype.gif=image/gif
          mimetype.html=text/html
          mimetype.jpg=image/jpeg
          mimetype.jpeg=image/jpeg
          mimetype.pdf=application/pdf
          mimetype.png=image/png
          mimetype.svg=image/svg+xml
          about-filter=${pkgs.cgit}/lib/cgit/filters/about-formatting.sh
          source-filter=${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py
          readme=:README.md
          root-title=simatime git repository
          root-desc=a computer is a bicycle for the mind.
          project-list=${gitDir}/projects.list
          scan-path=${gitDir}/repositories
        '';
      };
    };
  };
}