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

107 lines
2.5 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-10-20 18:54:38 +00:00
with import <stockholm/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 = {
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 = {
cgit.desc = "Tinc Advanced Graph Generation";
2015-10-19 17:46:26 +00:00
};
2016-06-02 09:13:31 +00:00
stockholm-init = {
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 = { };
2016-01-19 19:04:29 +00:00
init-stockholm = {
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 = { };
2017-02-04 13:35:29 +00:00
pass = { };
2015-07-28 17:56:53 +00:00
};
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 = {
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
make-priv-repo = name: { ... }: {
inherit name;
2015-07-28 17:56:53 +00:00
public = false;
};
2015-07-24 20:39:11 +00:00
make-krebs-repo = with git; name: { cgit ? {}, ... }: {
inherit cgit name;
2015-07-24 20:39:11 +00:00
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";
2017-10-01 12:28:34 +00:00
channel = "#xxx";
2015-07-29 12:22:24 +00:00
# TODO remove the hardcoded hostname
2017-10-01 12:01:19 +00:00
server = "irc.r";
2015-07-24 20:39:11 +00:00
};
};
};
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 ];
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;
cgit = {
settings = {
root-title = "public repositories";
root-desc = "keep on krebsing";
};
};
2015-07-28 18:21:34 +00:00
inherit repos rules;
};
}