diff options
| author | jeschli <jeschli@gmail.com> | 2018-12-04 19:27:27 +0100 |
|---|---|---|
| committer | jeschli <jeschli@gmail.com> | 2018-12-04 19:27:27 +0100 |
| commit | 5030b74cc5c578bb82619a24592504a6008f1a10 (patch) | |
| tree | 0551e3ddb94353b7438bec02174bf3379bc89b87 /nin/2configs/git.nix | |
| parent | 78b289201987675844aa37abeb4279eb4051ebe0 (diff) | |
| parent | 82988de84c177c247ebbe80940c4d50b9f073b4e (diff) | |
Merge branch 'master' of prism.r:stockholm
Diffstat (limited to 'nin/2configs/git.nix')
| -rw-r--r-- | nin/2configs/git.nix | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/nin/2configs/git.nix b/nin/2configs/git.nix deleted file mode 100644 index aed4a9f48..000000000 --- a/nin/2configs/git.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ config, lib, pkgs, ... }: - -with import <stockholm/lib>; - -let - - out = { - services.nginx.enable = true; - krebs.git = { - enable = true; - cgit = { - settings = { - root-title = "public repositories at ${config.krebs.build.host.name}"; - root-desc = "keep calm and engage"; - }; - }; - repos = mapAttrs (_: s: removeAttrs s ["collaborators"]) repos; - rules = rules; - }; - - krebs.iptables.tables.filter.INPUT.rules = [ - { predicate = "-i retiolum -p tcp --dport 80"; target = "ACCEPT"; } - ]; - }; - - repos = public-repos; - - rules = concatMap make-rules (attrValues repos); - - public-repos = mapAttrs make-public-repo { - stockholm = { - cgit.desc = "take all the computers hostage, they'll love you!"; - }; - }; - - make-public-repo = name: { cgit ? {}, ... }: { - inherit cgit name; - public = true; - }; - - make-rules = - with git // config.krebs.users; - repo: - singleton { - user = [ nin nin_h ]; - repo = [ repo ]; - perm = push "refs/*" [ non-fast-forward create delete merge ]; - } ++ - optional repo.public { - user = attrValues config.krebs.users; - repo = [ repo ]; - perm = fetch; - } ++ - optional (length (repo.collaborators or []) > 0) { - user = repo.collaborators; - repo = [ repo ]; - perm = fetch; - }; - -in out |
