2015-07-24 20:39:11 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2015-07-28 17:56:53 +00:00
|
|
|
# TODO: remove tv lib :)
|
2016-10-20 18:54:38 +00:00
|
|
|
with import <stockholm/lib>;
|
2015-07-24 20:39:11 +00:00
|
|
|
let
|
|
|
|
|
2018-03-07 16:06:46 +00:00
|
|
|
repos = priv-repos // krebs-repos // connector-repos // krebsroot-repos;
|
2015-11-17 12:55:30 +00:00
|
|
|
rules = concatMap krebs-rules (attrValues krebs-repos)
|
|
|
|
++ concatMap priv-rules (attrValues priv-repos)
|
2018-03-07 16:06:46 +00:00
|
|
|
++ concatMap connector-rules (attrValues connector-repos)
|
|
|
|
++ concatMap krebsroot-rules (attrValues krebsroot-repos);
|
|
|
|
|
|
|
|
krebsroot-repos = mapAttrs make-krebs-repo {
|
|
|
|
hydra-stockholm = { };
|
|
|
|
};
|
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 = {
|
2016-06-07 01:14:21 +00:00
|
|
|
cgit.desc = "Make all the systems into 1systems!";
|
2017-08-06 17:44:09 +00:00
|
|
|
};
|
|
|
|
stockholm-issues = {
|
|
|
|
cgit.desc = "Issue tracker";
|
2015-07-24 20:39:11 +00:00
|
|
|
};
|
2015-10-19 17:46:26 +00:00
|
|
|
tinc_graphs = {
|
2016-06-07 01:14:21 +00:00
|
|
|
cgit.desc = "Tinc Advanced Graph Generation";
|
2015-10-19 17:46:26 +00:00
|
|
|
};
|
2016-06-02 09:13:31 +00:00
|
|
|
stockholm-init = {
|
2016-06-07 01:14:21 +00:00
|
|
|
cgit.desc = "Build new Stockholm hosts";
|
2016-06-02 09:13:31 +00:00
|
|
|
};
|
2016-02-22 13:27:25 +00:00
|
|
|
cac-api = { };
|
2017-08-21 19:01:55 +00:00
|
|
|
euer_blog = { };
|
2017-05-12 09:37:00 +00:00
|
|
|
ampel = { };
|
2017-09-29 19:35:35 +00:00
|
|
|
europastats = { };
|
2018-04-04 12:45:45 +00:00
|
|
|
arafetch = { };
|
2018-09-16 22:47:28 +00:00
|
|
|
disko = { };
|
2016-01-19 19:04:29 +00:00
|
|
|
init-stockholm = {
|
2016-06-07 01:14:21 +00:00
|
|
|
cgit.desc = "Init stuff for stockholm";
|
2016-01-19 19:04:29 +00:00
|
|
|
};
|
2015-07-24 20:39:11 +00:00
|
|
|
};
|
|
|
|
|
2015-07-28 17:56:53 +00:00
|
|
|
priv-repos = mapAttrs make-priv-repo {
|
|
|
|
autosync = { };
|
2018-06-26 18:18:46 +00:00
|
|
|
fenkins = { };
|
2017-02-04 13:35:29 +00:00
|
|
|
pass = { };
|
2018-10-21 21:21:22 +00:00
|
|
|
secrets = { };
|
2015-07-28 17:56:53 +00:00
|
|
|
};
|
|
|
|
|
2015-11-17 12:55:30 +00:00
|
|
|
connector-repos = mapAttrs make-priv-repo {
|
2015-11-17 21:16:55 +00:00
|
|
|
connector = { };
|
2015-12-14 13:32:20 +00:00
|
|
|
minikrebs = { };
|
2015-12-03 19:36:09 +00:00
|
|
|
mattermost = {
|
2016-06-07 01:14:21 +00:00
|
|
|
cgit.desc = "Mattermost Docker files";
|
2015-12-03 19:36:09 +00:00
|
|
|
};
|
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
|
2016-06-07 01:14:21 +00:00
|
|
|
make-priv-repo = name: { ... }: {
|
|
|
|
inherit name;
|
2015-07-28 17:56:53 +00:00
|
|
|
public = false;
|
|
|
|
};
|
2015-07-24 20:39:11 +00:00
|
|
|
|
2016-06-07 01:14:21 +00:00
|
|
|
make-krebs-repo = with git; name: { cgit ? {}, ... }: {
|
|
|
|
inherit cgit name;
|
2015-07-24 20:39:11 +00:00
|
|
|
public = true;
|
|
|
|
};
|
|
|
|
|
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 ];
|
2017-10-08 20:20:46 +00:00
|
|
|
all-makefu = with config.krebs.users; [ makefu makefu-omo makefu-tsp makefu-vbob makefu-tempx makefu-android ];
|
2015-11-17 21:16:55 +00:00
|
|
|
all-exco = with config.krebs.users; [ exco ];
|
2015-07-29 12:22:24 +00:00
|
|
|
|
|
|
|
priv-rules = repo: set-owners repo all-makefu;
|
|
|
|
|
2015-11-17 21:16:55 +00:00
|
|
|
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
|
|
|
|
2018-03-07 16:06:46 +00:00
|
|
|
krebsroot-rules = repo:
|
|
|
|
set-owners repo (all-makefu ++ krebsminister);
|
|
|
|
|
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;
|
2016-06-07 01:14:21 +00:00
|
|
|
cgit = {
|
|
|
|
settings = {
|
|
|
|
root-title = "public repositories";
|
|
|
|
root-desc = "keep on krebsing";
|
|
|
|
};
|
|
|
|
};
|
2015-07-28 18:21:34 +00:00
|
|
|
inherit repos rules;
|
|
|
|
};
|
|
|
|
}
|