summaryrefslogtreecommitdiffstats
path: root/shared/2configs/cgit-mirror.nix
blob: c2326a5cc6dbe604a6dbf9384234c3c7c5745a53 (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
{ config, lib, pkgs, ... }:

with import <stockholm/lib>;
let
  rules = with git; singleton {
    user = [ wolf-repo-sync ];
    repo = [ stockholm-mirror ];
    perm = push ''refs/*'' [ non-fast-forward create delete merge ];
  };

  stockholm-mirror = {
    public = true;
    name = "stockholm-mirror";
    cgit.desc = "mirror for all stockholm branches";
    hooks = {
      post-receive = pkgs.git-hooks.irc-announce {
        nick = config.networking.hostName;
        verbose = false;
        channel = "#retiolum";
        server = "ni.r";
      };
    };
  };

  wolf-repo-sync = {
    name = "wolf-repo-sync";
    mail = "spam@krebsco.de";
    # TODO put git-sync pubkey somewhere more appropriate
    pubkey = ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwuAZB3wtAvBJFYh+gWdyGaZU4mtqM2dFXmh2rORlbXeh02msu1uv07ck1VKkQ4LgvCBcBsAOeVa1NTz99eLqutwgcqMCytvRNUCibcoEWwHObsK53KhDJj+zotwlFhnPPeK9+EpOP4ngh/tprJikttos5BwBwe2K+lfiid3fmVPZcTTYa77nCwijimMvWEx6CEjq1wiXMUc4+qcEn8Swbwomz/EEQdNE2hgoC3iMW9RqduTFdIJWnjVi0KaxenX9CvQRGbVK5SSu2gwzN59D/okQOCP6+p1gL5r3QRHSLSSRiEHctVQTkpKOifrtLZGSr5zArEmLd/cOVyssHQPCX repo-sync@wolf'';
  };

in {
  krebs.users.wolf-repo-sync = wolf-repo-sync;
  krebs.git = {
    enable = true;
    cgit = {
      settings = {
        root-title = "Shared Repos";
        root-desc = "keep on krebsing";
      };
    };
    inherit rules;
    repos.stockholm-mirror = stockholm-mirror;
  };
}