host cd: add all public repos

This commit is contained in:
tv 2015-06-19 00:36:27 +02:00
parent ca7048e27c
commit 959417b490

View File

@ -1,59 +1,75 @@
{ 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"; };
};
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";
hooks = {
post-receive = git.irc-announce {
nick = config.networking.hostName; # TODO make this the default
channel = "#retiolum";
server = "ire.retiolum";
};
};
public = true;
};
};
repos = listToAttrs (map ({ repo, ... }: { name = repo.name; value = repo; }) cd-repos);
rules = with git; with users; with repos; [
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
channel = "#retiolum";
server = "ire.retiolum";
};
};
public = true;
};
rules = with git; with users; [
{ user = tv;
repo = [ testing shitment ];
repo = [ repo ];
perm = push "refs/*" [ non-fast-forward create delete merge ];
}
{ user = [ lass makefu ];
repo = [ testing shitment ];
repo = [ repo ];
perm = fetch;
}
];
};
in
{
imports = [
../tv/git
];
services.git = {
enable = true;
inherit repos rules users;
};
}