summaryrefslogtreecommitdiffstats
path: root/configs/repo-sync/wiki.nix
blob: 94f7e801a084e7957ac70036e287736455e98199 (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
{ config, lib, mylib, pkgs, ... }: {
  krebs.repo-sync.enable = true;
  krebs.repo-sync.repos.wiki.branches.hotdog = {
    origin.url = "http://cgit.hotdog.r/wiki";
    mirror.url = "git@${config.krebs.build.host.name}.r:wiki";
  };
  krebs.git.repos.wiki = {
    public = true;
    name = "wiki";
    cgit.desc = toString [
      "mirror of"
      config.krebs.repo-sync.repos.wiki.branches.hotdog.origin.url
    ];
    cgit.section = "7. mirrors";
    hooks.post-receive = /* sh */ ''
      ${pkgs.git-hooks.irc-announce {
        channel = "#xxx";
        nick = config.krebs.build.host.name;
        server = "irc.r";
      }}
      ${pkgs.cgit-clear-cache.override {
        inherit (config.krebs.git.cgit.settings) cache-root;
      }}/bin/cgit-clear-cache
    '';
  };
  krebs.git.rules = lib.singleton {
    user = lib.singleton config.krebs.users.repo-sync;
    repo = lib.singleton config.krebs.git.repos.wiki;
    perm = mylib.git.push "refs/*" [
      mylib.git.create
      mylib.git.delete
      mylib.git.merge
      mylib.git.non-fast-forward
    ];
  };
  krebs.users.${config.krebs.repo-sync.user.name}.pubkey = {
    ni = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINK9U0Ob9/O0kxg3trhZY/vDnbqfN+R5cASGiClRr4IM";
  }.${config.krebs.build.host.name};
}