summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2015-06-19 00:36:27 +0200
committertv <tv@krebsco.de>2015-06-19 00:36:27 +0200
commite7f4705a095de835f2f511519100687e4be5d524 (patch)
tree65549c34a00854e6f7d0fcad9b9880b43cb5aa4f
parent5bb10af115dd1421fe9ee8629ceb5877730eaae2 (diff)
host cd: add all public repos
-rw-r--r--modules/cd/git.nix88
1 files changed, 52 insertions, 36 deletions
diff --git a/modules/cd/git.nix b/modules/cd/git.nix
index 88d4968..12dacff 100644
--- a/modules/cd/git.nix
+++ b/modules/cd/git.nix
@@ -1,39 +1,45 @@
{ config, lib, pkgs, ... }:
let
- inherit (builtins) readFile;
+ inherit (builtins) map readFile;
+ inherit (lib) concatMap listToAttrs;
# TODO lib should already include our stuff
inherit (import ../../lib { inherit lib pkgs; }) addNames git;
-in
-{
- imports = [
- ../tv/git
+ cd-repos = [
+ (public "cgserver")
+ (public "crude-mail-setup")
+ (public "dot-xmonad")
+ (public "hack")
+ (public "load-env")
+ (public "make-snapshot")
+ (public "mime")
+ (public "much")
+ (public "nixos-infest")
+ (public "nixpkgs")
+ (public "painload")
+ (public "regfish")
+ (public "repo")
+ (public "shitment")
+ (public "wai-middleware-time")
+ (public "web-routes-wai-custom")
+ (public "wu-configuration-nix")
];
- services.git = rec {
- enable = true;
+ users = addNames {
+ tv = { pubkey = readFile <pubkeys/tv.ssh.pub>; };
+ lass = { pubkey = "xxx"; };
+ makefu = { pubkey = "xxx"; };
+ };
- users = addNames {
- tv = { pubkey = readFile <pubkeys/tv.ssh.pub>; };
- lass = { pubkey = "xxx"; };
- makefu = { pubkey = "xxx"; };
- };
+ repos = listToAttrs (map ({ repo, ... }: { name = repo.name; value = repo; }) cd-repos);
- repos = addNames {
- shitment = {
- desc = "shitment repository";
- hooks = {
- post-receive = git.irc-announce {
- nick = config.networking.hostName; # TODO make this the default
- channel = "#retiolum";
- server = "ire.retiolum";
- };
- };
- public = true;
- };
- testing = {
- desc = "testing repository";
+ rules = concatMap ({ rules, ... }: rules) cd-repos;
+
+ public = repo-name:
+ rec {
+ repo = {
+ name = repo-name;
hooks = {
post-receive = git.irc-announce {
nick = config.networking.hostName; # TODO make this the default
@@ -43,17 +49,27 @@ in
};
public = true;
};
+ rules = with git; with users; [
+ { user = tv;
+ repo = [ repo ];
+ perm = push "refs/*" [ non-fast-forward create delete merge ];
+ }
+ { user = [ lass makefu ];
+ repo = [ repo ];
+ perm = fetch;
+ }
+ ];
};
- rules = with git; with users; with repos; [
- { user = tv;
- repo = [ testing shitment ];
- perm = push "refs/*" [ non-fast-forward create delete merge ];
- }
- { user = [ lass makefu ];
- repo = [ testing shitment ];
- perm = fetch;
- }
- ];
+in
+
+{
+ imports = [
+ ../tv/git
+ ];
+
+ services.git = {
+ enable = true;
+ inherit repos rules users;
};
}