summaryrefslogtreecommitdiffstats
path: root/2configs
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2015-07-28 21:49:48 +0200
committerlassulus <lass@aidsballs.de>2015-07-28 21:49:48 +0200
commitce2b97767e201d11ed4d34d8de770eb74da17125 (patch)
treedf2dae28296dfc29ac3a98ad0952cd27f7d382a3 /2configs
parent12644fe303a6045d6d8ae75916cb601f95596f25 (diff)
parent3228890813535514dfdfe9d049486a9e6054e479 (diff)
Merge remote-tracking branch 'cd/user-toplevel' into newmaster
Diffstat (limited to '2configs')
-rw-r--r--2configs/makefu/cgit-retiolum.nix44
1 files changed, 31 insertions, 13 deletions
diff --git a/2configs/makefu/cgit-retiolum.nix b/2configs/makefu/cgit-retiolum.nix
index d5ad35fda..7b8e3bc97 100644
--- a/2configs/makefu/cgit-retiolum.nix
+++ b/2configs/makefu/cgit-retiolum.nix
@@ -1,4 +1,5 @@
{ config, lib, pkgs, ... }:
+# TODO: remove tv lib :)
with import ../../4lib/tv { inherit lib pkgs; };
let
@@ -7,23 +8,31 @@ let
krebs.git = {
enable = true;
root-title = "public repositories ";
- root-desc = "keep calm and enrage";
- inherit repos rules ;
+ root-desc = "keep on krebsing";
+ inherit repos rules;
};
};
+ repos = priv-repos // krebs-repos ;
+ rules = concatMap krebs-rules (attrValues krebs-repos) ++ concatMap priv-rules (attrValues priv-repos);
- repos = public-repos;
- rules = concatMap make-rules (attrValues repos);
-
- public-repos = mapAttrs make-public-repo {
+ krebs-repos = mapAttrs make-krebs-repo {
stockholm = {
desc = "take all the computers hostage, they'll love you!";
};
};
+ priv-repos = mapAttrs make-priv-repo {
+ autosync = { };
+ };
+
+
# TODO move users to separate module
+ make-priv-repo = name: { desc ? null, ... }: {
+ inherit name desc;
+ public = false;
+ };
- make-public-repo = name: { desc ? null, ... }: {
+ make-krebs-repo = with git; name: { desc ? null, ... }: {
inherit name desc;
public = true;
hooks = {
@@ -35,18 +44,27 @@ let
};
};
- make-rules =
- with git // config.krebs.users;
- repo:
+ set-owners = with git; repo: user:
singleton {
- user = makefu;
+ inherit user;
repo = [ repo ];
perm = push "refs/*" [ non-fast-forward create delete merge ];
- } ++
+ };
+
+ set-ro-access = with git; repo: user:
optional repo.public {
- user = [ lass tv uriel ];
+ inherit user;
repo = [ repo ];
perm = fetch;
};
+ # TODO: get the list of all krebsministers
+ krebsminister = with config.krebs.users; [ lass tv uriel ];
+
+ priv-rules = with config.krebs.users; repo:
+ set-owners repo [ makefu ];
+
+ krebs-rules = with config.krebs.users; repo:
+ set-owners repo [ makefu ] ++ set-ro-access repo krebsminister ;
+
in out