stockholm/makefu/2configs/git/cgit-retiolum.nix

93 lines
2.2 KiB
Nix
Raw Normal View History

2015-07-24 20:39:11 +00:00
{ config, lib, pkgs, ... }:
2015-07-28 17:56:53 +00:00
# TODO: remove tv lib :)
2016-02-14 15:43:44 +00:00
with config.krebs.lib;
2015-07-24 20:39:11 +00:00
let
2015-11-17 12:55:30 +00: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);
2015-07-24 20:39:11 +00:00
2015-07-28 17:56:53 +00:00
krebs-repos = mapAttrs make-krebs-repo {
2015-07-24 20:39:11 +00:00
stockholm = {
desc = "Make all the systems into 1systems!";
2015-07-24 20:39:11 +00:00
};
2015-10-19 17:46:26 +00:00
tinc_graphs = {
desc = "Tinc Advanced Graph Generation";
};
2016-02-22 13:27:25 +00:00
cac-api = { };
2016-01-19 19:04:29 +00:00
init-stockholm = {
desc = "Init stuff for stockholm";
};
2015-07-24 20:39:11 +00:00
};
2015-07-28 17:56:53 +00:00
priv-repos = mapAttrs make-priv-repo {
autosync = { };
};
2015-11-17 12:55:30 +00:00
connector-repos = mapAttrs make-priv-repo {
connector = { };
2015-12-14 13:32:20 +00:00
minikrebs = { };
2015-12-03 19:36:09 +00:00
mattermost = {
desc = "Mattermost Docker files";
};
2015-11-17 12:55:30 +00:00
};
2015-07-28 17:56:53 +00:00
2015-07-24 20:39:11 +00:00
# TODO move users to separate module
2015-07-28 17:56:53 +00:00
make-priv-repo = name: { desc ? null, ... }: {
inherit name desc;
public = false;
};
2015-07-24 20:39:11 +00:00
2015-07-28 17:56:53 +00:00
make-krebs-repo = with git; name: { desc ? null, ... }: {
2015-07-24 20:39:11 +00:00
inherit name desc;
public = true;
hooks = {
post-receive = pkgs.git-hooks.irc-announce {
2015-07-24 20:39:11 +00:00
nick = config.networking.hostName;
2015-12-14 13:36:36 +00:00
verbose = config.krebs.build.host.name == "gum";
2015-07-24 20:39:11 +00:00
channel = "#retiolum";
2015-07-29 12:22:24 +00:00
# TODO remove the hardcoded hostname
2015-07-24 20:39:11 +00:00
server = "cd.retiolum";
};
};
};
2015-07-28 17:56:53 +00:00
2015-07-24 20:39:11 +00:00
2015-07-28 17:56:53 +00:00
# TODO: get the list of all krebsministers
2016-02-17 02:13:42 +00:00
krebsminister = with config.krebs.users; [ lass tv ];
2015-12-14 13:32:20 +00:00
all-makefu = with config.krebs.users; [ makefu makefu-omo makefu-tsp makefu-vbob ];
all-exco = with config.krebs.users; [ exco ];
2015-07-29 12:22:24 +00: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 12:55:30 +00:00
2015-07-29 12:22:24 +00:00
krebs-rules = repo:
set-owners repo all-makefu ++ set-ro-access repo krebsminister;
2015-07-28 17:56:53 +00:00
2015-11-17 12:55:30 +00: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 ];
};
2015-07-28 18:21:34 +00:00
in {
krebs.git = {
enable = true;
2015-07-29 12:22:24 +00:00
root-title = "public repositories";
2015-07-28 18:21:34 +00:00
root-desc = "keep on krebsing";
inherit repos rules;
};
}