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

99 lines
2.3 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
# TODO: remove tv lib :)
2016-10-20 20:54:38 +02:00
with import <stockholm/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 = {
cgit.desc = "Make all the systems into 1systems!";
2017-08-06 19:44:09 +02:00
};
stockholm-issues = {
cgit.desc = "Issue tracker";
};
2015-10-19 19:46:26 +02:00
tinc_graphs = {
cgit.desc = "Tinc Advanced Graph Generation";
2015-10-19 19:46:26 +02:00
};
2016-06-02 11:13:31 +02:00
stockholm-init = {
cgit.desc = "Build new Stockholm hosts";
2016-06-02 11:13:31 +02:00
};
2016-02-22 14:27:25 +01:00
cac-api = { };
2017-08-21 21:01:55 +02:00
euer_blog = { };
2017-05-12 11:37:00 +02:00
ampel = { };
2017-09-29 21:35:35 +02:00
europastats = { };
2016-01-19 20:04:29 +01:00
init-stockholm = {
cgit.desc = "Init stuff for stockholm";
2016-01-19 20:04:29 +01:00
};
2018-02-26 22:03:59 +01:00
hydra-stockholm = { };
};
priv-repos = mapAttrs make-priv-repo {
autosync = { };
2017-02-04 14:35:29 +01:00
pass = { };
};
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 = {
cgit.desc = "Mattermost Docker files";
2015-12-03 20:36:09 +01:00
};
2015-11-17 13:55:30 +01:00
};
# TODO move users to separate module
make-priv-repo = name: { ... }: {
inherit name;
public = false;
};
make-krebs-repo = with git; name: { cgit ? {}, ... }: {
inherit cgit name;
public = true;
};
# TODO: get the list of all krebsministers
2016-02-17 03:13:42 +01:00
krebsminister = with config.krebs.users; [ lass tv ];
2017-10-08 22:20:46 +02: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 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;
cgit = {
settings = {
root-title = "public repositories";
root-desc = "keep on krebsing";
};
};
inherit repos rules;
};
}