stockholm/modules/tv/git/public.nix

74 lines
1.8 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
let
2015-06-18 22:36:27 +00:00
inherit (builtins) map readFile;
inherit (lib) concatMap listToAttrs;
# TODO lib should already include our stuff
2015-06-19 19:40:00 +00:00
inherit (import ../../../lib { inherit lib pkgs; }) addNames git;
2015-06-19 19:40:00 +00:00
public-git-repos = [
2015-06-18 22:36:27 +00:00
(public "cgserver")
(public "crude-mail-setup")
(public "dot-xmonad")
(public "hack")
(public "load-env")
(public "make-snapshot")
(public "mime")
(public "much")
(public "nixos-infest")
2015-06-28 10:06:38 +00:00
(public "nixpkgs")
2015-06-18 22:36:27 +00:00
(public "painload")
(public "regfish")
(public "shitment")
(public "wai-middleware-time")
(public "web-routes-wai-custom")
];
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-22 20:19:02 +00:00
makefu = { pubkey = readFile <pubkeys/makefu.ssh.pub>; };
2015-06-18 22:36:27 +00:00
};
2015-06-19 19:40:00 +00:00
repos = listToAttrs (map ({ repo, ... }: { name = repo.name; value = repo; }) public-git-repos);
2015-06-19 19:40:00 +00:00
rules = concatMap ({ rules, ... }: rules) public-git-repos;
2015-06-18 22:36:27 +00:00
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;
};
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 22:36:27 +00:00
in
{
imports = [
2015-06-19 19:40:00 +00:00
./.
2015-06-18 22:36:27 +00:00
];
tv.git = {
2015-06-18 22:36:27 +00:00
enable = true;
inherit repos rules users;
};
}