summaryrefslogtreecommitdiffstats
path: root/modules/cd/git.nix
blob: 88d4968a6fee379370b39e6ef4d78accda09de3d (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
{ config, lib, pkgs, ... }:

let
  inherit (builtins) readFile;
  # TODO lib should already include our stuff
  inherit (import ../../lib { inherit lib pkgs; }) addNames git;
in

{
  imports = [
    ../tv/git
  ];

  services.git = rec {
    enable = true;

    users = addNames {
      tv = { pubkey = readFile <pubkeys/tv.ssh.pub>; };
      lass = { pubkey = "xxx"; };
      makefu = { pubkey = "xxx"; };
    };

    repos = addNames {
      shitment = {
        desc = "shitment repository";
        hooks = {
          post-receive = git.irc-announce {
            nick = config.networking.hostName; # TODO make this the default
            channel = "#retiolum";
            server = "ire.retiolum";
          };
        };
        public = true;
      };
      testing = {
        desc = "testing repository";
        hooks = {
          post-receive = git.irc-announce {
            nick = config.networking.hostName; # TODO make this the default
            channel = "#retiolum";
            server = "ire.retiolum";
          };
        };
        public = true;
      };
    };

    rules = with git; with users; with repos; [
      { user = tv;
        repo = [ testing shitment ];
        perm = push "refs/*" [ non-fast-forward create delete merge ];
      }
      { user = [ lass makefu ];
        repo = [ testing shitment ];
        perm = fetch;
      }
    ];
  };
}