summaryrefslogtreecommitdiffstats
path: root/lass/2configs/git.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2017-09-19 11:42:50 +0200
committerlassulus <lassulus@lassul.us>2017-09-19 11:42:50 +0200
commitca89d9a176cdbda04bacecf809bf2346a615891e (patch)
treeb0381e131532dbe7065f52e33c17964e9f2c386e /lass/2configs/git.nix
parent797535fc1ff1dd88239e06ecee861d228107c6e9 (diff)
l git: use repo.admins
Diffstat (limited to 'lass/2configs/git.nix')
-rw-r--r--lass/2configs/git.nix17
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