diff options
author | nin <nineinchnade@gmail.com> | 2017-09-29 19:11:43 +0200 |
---|---|---|
committer | nin <nineinchnade@gmail.com> | 2017-09-29 19:11:43 +0200 |
commit | f4bf9110727f2c7113c80aaa88427b81605016ae (patch) | |
tree | a56a491867eeb0deaca97c7ff272d563a026ec5c /lass/2configs/git.nix | |
parent | 7a7d085d33e1aa8e97f9f91d0fe53a1e378ce75e (diff) | |
parent | 6dfe071664136790b7d62bf062e090722997372f (diff) |
Merge branch 'master' of prism:stockholm
Diffstat (limited to 'lass/2configs/git.nix')
-rw-r--r-- | lass/2configs/git.nix | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lass/2configs/git.nix b/lass/2configs/git.nix index 7bce93ae1..3991acadc 100644 --- a/lass/2configs/git.nix +++ b/lass/2configs/git.nix @@ -14,7 +14,7 @@ let root-desc = "keep calm and engage"; }; }; - repos = mapAttrs (_: s: removeAttrs s ["collaborators"]) repos; + repos = repos; rules = rules; }; @@ -87,8 +87,8 @@ let public = true; }; - make-restricted-repo = name: { collaborators ? [], announce ? false, hooks ? {}, ... }: { - inherit collaborators name; + make-restricted-repo = name: { admins ? [], collaborators ? [], announce ? false, hooks ? {}, ... }: { + inherit admins collaborators name; public = false; hooks = optionalAttrs announce { post-receive = pkgs.git-hooks.irc-announce { @@ -111,15 +111,20 @@ let repo = [ repo ]; perm = push "refs/*" [ non-fast-forward create delete merge ]; } ++ - optional repo.public { - user = attrValues config.krebs.users; + optional (length (repo.admins or []) > 0) { + user = repo.admins; repo = [ repo ]; - perm = fetch; + perm = push "refs/*" [ non-fast-forward create delete merge ]; } ++ optional (length (repo.collaborators or []) > 0) { user = repo.collaborators; repo = [ repo ]; perm = fetch; + } ++ + optional repo.public { + user = attrValues config.krebs.users; + repo = [ repo ]; + perm = fetch; }; in out |