summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/git.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-06-07 22:41:40 +0200
committertv <tv@krebsco.de>2016-06-07 22:41:40 +0200
commitc655e1246daa04abc4cd83dbb62b86dda1d357d4 (patch)
treedc5aed4f3c655082c019096db6c8a590af489fb1 /krebs/3modules/git.nix
parent4a34b27c1c6c3fea2b336c0316c597d74460b428 (diff)
krebs.git: s/ensureList/toList/
Diffstat (limited to 'krebs/3modules/git.nix')
-rw-r--r--krebs/3modules/git.nix16
1 files changed, 6 insertions, 10 deletions
diff --git a/krebs/3modules/git.nix b/krebs/3modules/git.nix
index d1ab2ce64..9bc56fc85 100644
--- a/krebs/3modules/git.nix
+++ b/krebs/3modules/git.nix
@@ -290,15 +290,15 @@ let
environment.etc."${etc-base}".source =
scriptFarm "git-ssh-authorizers" {
authorize-command = makeAuthorizeScript (map (rule: [
- (map getName (ensureList rule.user))
- (map getName (ensureList rule.repo))
+ (map getName (toList rule.user))
+ (map getName (toList rule.repo))
(map getName rule.perm.allow-commands)
]) cfg.rules);
authorize-push = makeAuthorizeScript (map (rule: [
- (map getName (ensureList rule.user))
- (map getName (ensureList rule.repo))
- (ensureList rule.perm.allow-receive-ref)
+ (map getName (toList rule.user))
+ (map getName (toList rule.repo))
+ (toList rule.perm.allow-receive-ref)
(map getName rule.perm.allow-receive-modes)
]) (filter (rule: rule.perm.allow-receive-ref != null) cfg.rules));
};
@@ -400,10 +400,6 @@ let
gid = fcgitwrap-user.uid;
};
-
- ensureList = x:
- if typeOf x == "list" then x else [x];
-
getName = x: x.name;
isPublicRepo = getAttr "public"; # TODO this is also in ./cgit.nix
@@ -428,7 +424,7 @@ let
makeAuthorizeScript =
let
# TODO escape
- to-pattern = x: concatStringsSep "|" (ensureList x);
+ to-pattern = x: concatStringsSep "|" (toList x);
go = i: ps:
if ps == []
then "exit 0"