stockholm/2configs/tv/git-public.nix

81 lines
1.9 KiB
Nix
Raw Normal View History

2015-07-11 14:55:22 +00:00
{ config, lib, pkgs, ... }:
2015-07-23 22:24:12 +00:00
with import ../../4lib/tv { inherit lib pkgs; };
2015-07-11 14:55:22 +00:00
let
2015-07-23 22:24:12 +00:00
out = {
2015-07-24 09:44:49 +00:00
imports = [ ../../3modules/krebs/git.nix ];
krebs.git = {
2015-07-23 22:24:12 +00:00
enable = true;
root-title = "public repositories at ${config.tv.identity.self.name}";
root-desc = "keep calm and engage";
inherit repos rules users;
};
2015-07-11 14:55:22 +00:00
};
2015-07-23 22:24:12 +00:00
repos = public-repos;
rules = concatMap make-rules (attrValues repos);
2015-07-11 14:55:22 +00:00
2015-07-23 22:24:12 +00:00
public-repos = mapAttrs make-public-repo {
cgserver = {};
crude-mail-setup = {};
dot-xmonad = {};
hack = {};
load-env = {};
make-snapshot = {};
mime = {};
much = {};
nixos-infest = {};
nixpkgs = {};
painload = {};
quipper = {};
regfish = {};
stockholm = {
desc = "take all the computers hostage, they'll love you!";
};
wai-middleware-time = {};
web-routes-wai-custom = {};
xintmap = {};
};
2015-07-11 14:55:22 +00:00
2015-07-23 22:24:12 +00:00
# TODO move users to separate module
users = mapAttrs make-user {
tv = ../../Zpubkeys/tv_wu.ssh.pub;
lass = ../../Zpubkeys/lass.ssh.pub;
uriel = ../../Zpubkeys/uriel.ssh.pub;
makefu = ../../Zpubkeys/makefu.ssh.pub;
};
2015-07-11 14:55:22 +00:00
2015-07-23 22:24:12 +00:00
make-public-repo = name: { desc ? null, ... }: {
inherit name desc;
public = true;
hooks = {
post-receive = git.irc-announce {
# TODO make nick = config.tv.identity.self.name the default
nick = config.tv.identity.self.name;
channel = "#retiolum";
server = "cd.retiolum";
2015-07-11 14:55:22 +00:00
};
};
2015-07-23 22:24:12 +00:00
};
2015-07-11 14:55:22 +00:00
2015-07-23 22:24:12 +00:00
make-rules =
with git // users;
repo:
singleton {
user = tv;
repo = [ repo ];
perm = push "refs/*" [ non-fast-forward create delete merge ];
} ++
optional repo.public {
user = [ lass makefu uriel ];
repo = [ repo ];
perm = fetch;
};
2015-07-11 14:55:22 +00:00
2015-07-23 22:24:12 +00:00
make-user = name: pubkey-file: {
inherit name;
pubkey = readFile pubkey-file;
2015-07-11 14:55:22 +00:00
};
2015-07-23 22:24:12 +00:00
in out