nixos-config/2configs/git/cgit-retiolum.nix

96 lines
2.3 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
# TODO: remove tv lib :)
2016-02-14 16:43:44 +01:00
with config.krebs.lib;
let
2015-11-17 13:55:30 +01:00
repos = priv-repos // krebs-repos // connector-repos ;
rules = concatMap krebs-rules (attrValues krebs-repos)
++ concatMap priv-rules (attrValues priv-repos)
++ concatMap connector-rules (attrValues connector-repos);
krebs-repos = mapAttrs make-krebs-repo {
stockholm = {
desc = "Make all the systems into 1systems!";
};
2015-10-19 19:46:26 +02:00
tinc_graphs = {
desc = "Tinc Advanced Graph Generation";
};
2016-06-02 11:13:31 +02:00
stockholm-init = {
desc = "Build new Stockholm hosts";
};
2016-02-22 14:27:25 +01:00
cac-api = { };
2016-01-19 20:04:29 +01:00
init-stockholm = {
desc = "Init stuff for stockholm";
};
};
priv-repos = mapAttrs make-priv-repo {
autosync = { };
};
2015-11-17 13:55:30 +01:00
connector-repos = mapAttrs make-priv-repo {
connector = { };
2015-12-14 14:32:20 +01:00
minikrebs = { };
2015-12-03 20:36:09 +01:00
mattermost = {
desc = "Mattermost Docker files";
};
2015-11-17 13:55:30 +01:00
};
# 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;
public = true;
hooks = {
post-receive = pkgs.git-hooks.irc-announce {
nick = config.networking.hostName;
2015-12-14 14:36:36 +01:00
verbose = config.krebs.build.host.name == "gum";
channel = "#retiolum";
2015-07-29 14:22:24 +02:00
# TODO remove the hardcoded hostname
server = "cd.retiolum";
};
};
};
# TODO: get the list of all krebsministers
2016-02-17 03:13:42 +01:00
krebsminister = with config.krebs.users; [ lass tv ];
2015-12-14 14:32:20 +01:00
all-makefu = with config.krebs.users; [ makefu makefu-omo makefu-tsp makefu-vbob ];
all-exco = with config.krebs.users; [ exco ];
2015-07-29 14:22:24 +02:00
priv-rules = repo: set-owners repo all-makefu;
connector-rules = repo: set-owners repo all-makefu ++ set-owners repo all-exco;
2015-11-17 13:55:30 +01:00
2015-07-29 14:22:24 +02:00
krebs-rules = repo:
set-owners repo all-makefu ++ set-ro-access repo krebsminister;
2015-11-17 13:55:30 +01:00
set-ro-access = with git; repo: user:
optional repo.public {
inherit user;
repo = [ repo ];
perm = fetch;
};
set-owners = with git;repo: user:
singleton {
inherit user;
repo = [ repo ];
perm = push "refs/*" [ non-fast-forward create delete merge ];
};
in {
krebs.git = {
enable = true;
2015-07-29 14:22:24 +02:00
root-title = "public repositories";
root-desc = "keep on krebsing";
inherit repos rules;
};
}