2015-06-18 21:59:14 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2015-06-18 22:36:27 +00:00
|
|
|
inherit (builtins) map readFile;
|
|
|
|
inherit (lib) concatMap listToAttrs;
|
2015-06-18 21:59:14 +00:00
|
|
|
# TODO lib should already include our stuff
|
|
|
|
inherit (import ../../lib { inherit lib pkgs; }) addNames git;
|
|
|
|
|
2015-06-18 22:36:27 +00:00
|
|
|
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 "painload")
|
|
|
|
(public "regfish")
|
|
|
|
(public "shitment")
|
|
|
|
(public "wai-middleware-time")
|
|
|
|
(public "web-routes-wai-custom")
|
2015-06-18 21:59:14 +00:00
|
|
|
];
|
|
|
|
|
2015-06-18 22:36:27 +00:00
|
|
|
users = addNames {
|
2015-06-18 23:35:37 +00:00
|
|
|
tv = { pubkey = readFile <pubkeys/tv_wu.ssh.pub>; };
|
2015-06-18 23:03:17 +00:00
|
|
|
lass = { pubkey = readFile <pubkeys/lass.ssh.pub>; };
|
|
|
|
uriel = { pubkey = readFile <pubkeys/uriel.ssh.pub>; };
|
2015-06-18 22:36:27 +00:00
|
|
|
makefu = { pubkey = "xxx"; };
|
|
|
|
};
|
2015-06-18 21:59:14 +00:00
|
|
|
|
2015-06-18 22:36:27 +00:00
|
|
|
repos = listToAttrs (map ({ repo, ... }: { name = repo.name; value = repo; }) cd-repos);
|
2015-06-18 21:59:14 +00:00
|
|
|
|
2015-06-18 22:36:27 +00:00
|
|
|
rules = concatMap ({ rules, ... }: rules) cd-repos;
|
|
|
|
|
|
|
|
public = repo-name:
|
|
|
|
rec {
|
|
|
|
repo = {
|
|
|
|
name = repo-name;
|
2015-06-18 21:59:14 +00:00
|
|
|
hooks = {
|
|
|
|
post-receive = git.irc-announce {
|
|
|
|
nick = config.networking.hostName; # TODO make this the default
|
|
|
|
channel = "#retiolum";
|
|
|
|
server = "ire.retiolum";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
public = true;
|
|
|
|
};
|
2015-06-18 22:36:27 +00:00
|
|
|
rules = with git; with users; [
|
|
|
|
{ user = tv;
|
|
|
|
repo = [ repo ];
|
|
|
|
perm = push "refs/*" [ non-fast-forward create delete merge ];
|
|
|
|
}
|
2015-06-18 23:03:17 +00:00
|
|
|
{ user = [ lass makefu uriel ];
|
2015-06-18 22:36:27 +00:00
|
|
|
repo = [ repo ];
|
|
|
|
perm = fetch;
|
|
|
|
}
|
|
|
|
];
|
2015-06-18 21:59:14 +00:00
|
|
|
};
|
|
|
|
|
2015-06-18 22:36:27 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
../tv/git
|
|
|
|
];
|
|
|
|
|
|
|
|
services.git = {
|
|
|
|
enable = true;
|
|
|
|
inherit repos rules users;
|
2015-06-18 21:59:14 +00:00
|
|
|
};
|
|
|
|
}
|