summaryrefslogtreecommitdiffstats
path: root/modules/cd/git.nix
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-06-19 00:36:27 +0200
committertv <tv@shackspace.de>2015-06-19 00:36:27 +0200
commit959417b490847ca28f10ba8ae8486b496ecb7dd9 (patch)
tree65549c34a00854e6f7d0fcad9b9880b43cb5aa4f /modules/cd/git.nix
parentca7048e27cfdc354dd0fdf17e971548cb0adbba9 (diff)
host cd: add all public repos
Diffstat (limited to 'modules/cd/git.nix')
-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 88d4968a6..12dacffc2 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;
};
}