m 2 git: fix library and irc hooks

This commit is contained in:
makefu 2015-11-17 13:55:30 +01:00
parent b69dcc6086
commit 4fec1920fb
2 changed files with 35 additions and 19 deletions

View File

@ -1,6 +1,6 @@
{ config, lib, pkgs, ... }:
# TODO: remove tv lib :)
with import ../../../tv/4lib { inherit lib pkgs; };
with lib;
let
repos = priv-repos // krebs-repos ;
@ -26,7 +26,7 @@ let
inherit name desc;
public = false;
hooks = {
post-receive = git.irc-announce {
post-receive = pkgs.git-hooks.irc-announce {
nick = config.networking.hostName;
channel = "#retiolum";
# TODO remove the hardcoded hostname

View File

@ -1,10 +1,12 @@
{ config, lib, pkgs, ... }:
# TODO: remove tv lib :)
with import ../../../tv/4lib { inherit lib pkgs; };
with lib;
let
repos = priv-repos // krebs-repos ;
rules = concatMap krebs-rules (attrValues krebs-repos) ++ concatMap priv-rules (attrValues priv-repos);
repos = priv-repos // krebs-repos // connector-repos ;
rules = concatMap krebs-rules (attrValues krebs-repos)
++ concatMap priv-rules (attrValues priv-repos)
++ concatMap connector-rules (attrValues connector-repos);
krebs-repos = mapAttrs make-krebs-repo {
stockholm = {
@ -19,6 +21,10 @@ let
autosync = { };
};
connector-repos = mapAttrs make-priv-repo {
autosync = { };
};
# TODO move users to separate module
make-priv-repo = name: { desc ? null, ... }: {
@ -40,12 +46,19 @@ let
};
};
set-owners = with git;repo: user:
singleton {
inherit user;
repo = [ repo ];
perm = push "refs/*" [ non-fast-forward create delete merge ];
};
# TODO: get the list of all krebsministers
krebsminister = with config.krebs.users; [ lass tv uriel ];
all-makefu = with config.krebs.users; [ makefu makefu-omo makefu-tsp ];
exco = with config.krebs.users; [ exco ];
priv-rules = repo: set-owners repo all-makefu;
connector-rules = repo: set-owners repo (all-makefu ++ exco);
krebs-rules = repo:
set-owners repo all-makefu ++ set-ro-access repo krebsminister;
set-ro-access = with git; repo: user:
optional repo.public {
@ -54,14 +67,12 @@ let
perm = fetch;
};
# TODO: get the list of all krebsministers
krebsminister = with config.krebs.users; [ lass tv uriel ];
all-makefu = with config.krebs.users; [ makefu makefu-omo makefu-tsp ];
priv-rules = repo: set-owners repo all-makefu;
krebs-rules = repo:
set-owners repo all-makefu ++ set-ro-access repo krebsminister;
set-owners = with git;repo: user:
singleton {
inherit user;
repo = [ repo ];
perm = push "refs/*" [ non-fast-forward create delete merge ];
};
in {
imports = [{
@ -73,6 +84,11 @@ in {
name = "makefu-tsp" ;
pubkey= with builtins; readFile ../../../krebs/Zpubkeys/makefu_tsp.ssh.pub;
};
krebs.users.exco = {
name = "exco" ;
pubkey= with builtins; readFile ../../../krebs/Zpubkeys/exco.ssh.pub;
};
}];
krebs.git = {
enable = true;