2015-07-28 20:19:54 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
# TODO: remove tv lib :)
|
2015-11-17 13:55:30 +01:00
|
|
|
with lib;
|
2015-07-28 20:19:54 +02:00
|
|
|
let
|
|
|
|
|
|
|
|
repos = priv-repos // krebs-repos ;
|
|
|
|
rules = concatMap krebs-rules (attrValues krebs-repos) ++ concatMap priv-rules (attrValues priv-repos);
|
|
|
|
|
|
|
|
krebs-repos = mapAttrs make-krebs-repo {
|
2015-09-02 10:02:05 +02:00
|
|
|
brain = {
|
|
|
|
desc = "braiiiins";
|
2015-07-28 20:19:54 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
priv-repos = mapAttrs make-priv-repo {
|
|
|
|
autosync = { };
|
|
|
|
};
|
|
|
|
|
|
|
|
# TODO move users to separate module
|
|
|
|
make-priv-repo = name: { desc ? null, ... }: {
|
|
|
|
inherit name desc;
|
|
|
|
public = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
make-krebs-repo = with git; name: { desc ? null, ... }: {
|
|
|
|
inherit name desc;
|
2015-09-02 10:02:05 +02:00
|
|
|
public = false;
|
2015-07-28 20:19:54 +02:00
|
|
|
hooks = {
|
2015-11-17 13:55:30 +01:00
|
|
|
post-receive = pkgs.git-hooks.irc-announce {
|
2015-07-28 20:19:54 +02:00
|
|
|
nick = config.networking.hostName;
|
|
|
|
channel = "#retiolum";
|
2015-07-29 14:22:24 +02:00
|
|
|
# TODO remove the hardcoded hostname
|
2015-07-28 20:19:54 +02:00
|
|
|
server = "cd.retiolum";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2015-07-29 14:22:24 +02:00
|
|
|
set-owners = with git;repo: user:
|
2015-07-28 20:19:54 +02:00
|
|
|
singleton {
|
|
|
|
inherit user;
|
|
|
|
repo = [ repo ];
|
|
|
|
perm = push "refs/*" [ non-fast-forward create delete merge ];
|
|
|
|
};
|
|
|
|
|
|
|
|
set-ro-access = with git; repo: user:
|
2015-10-10 20:21:52 +02:00
|
|
|
singleton {
|
2015-07-28 20:19:54 +02:00
|
|
|
inherit user;
|
|
|
|
repo = [ repo ];
|
|
|
|
perm = fetch;
|
|
|
|
};
|
|
|
|
|
|
|
|
# TODO: get the list of all krebsministers
|
2015-09-02 10:02:05 +02:00
|
|
|
krebsminister = with config.krebs.users; [ lass tv ];
|
2015-08-09 15:13:01 +02:00
|
|
|
all-makefu = with config.krebs.users; [ makefu makefu-omo makefu-tsp ];
|
2015-07-29 14:22:24 +02:00
|
|
|
|
|
|
|
priv-rules = repo: set-owners repo all-makefu;
|
|
|
|
|
|
|
|
krebs-rules = repo:
|
|
|
|
set-owners repo all-makefu ++ set-ro-access repo krebsminister;
|
2015-07-28 20:19:54 +02:00
|
|
|
|
2015-07-29 11:56:31 +02:00
|
|
|
in {
|
2015-12-17 17:38:33 +01:00
|
|
|
imports = [ ];
|
2015-07-29 11:56:31 +02:00
|
|
|
krebs.git = {
|
|
|
|
enable = true;
|
2015-09-02 10:02:05 +02:00
|
|
|
cgit = false;
|
2015-07-29 11:56:31 +02:00
|
|
|
inherit repos rules;
|
|
|
|
};
|
|
|
|
}
|