m 2 git: fix library and irc hooks
This commit is contained in:
parent
b69dcc6086
commit
4fec1920fb
@ -1,6 +1,6 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
# TODO: remove tv lib :)
|
# TODO: remove tv lib :)
|
||||||
with import ../../../tv/4lib { inherit lib pkgs; };
|
with lib;
|
||||||
let
|
let
|
||||||
|
|
||||||
repos = priv-repos // krebs-repos ;
|
repos = priv-repos // krebs-repos ;
|
||||||
@ -26,7 +26,7 @@ let
|
|||||||
inherit name desc;
|
inherit name desc;
|
||||||
public = false;
|
public = false;
|
||||||
hooks = {
|
hooks = {
|
||||||
post-receive = git.irc-announce {
|
post-receive = pkgs.git-hooks.irc-announce {
|
||||||
nick = config.networking.hostName;
|
nick = config.networking.hostName;
|
||||||
channel = "#retiolum";
|
channel = "#retiolum";
|
||||||
# TODO remove the hardcoded hostname
|
# TODO remove the hardcoded hostname
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
# TODO: remove tv lib :)
|
# TODO: remove tv lib :)
|
||||||
with import ../../../tv/4lib { inherit lib pkgs; };
|
with lib;
|
||||||
let
|
let
|
||||||
|
|
||||||
repos = priv-repos // krebs-repos ;
|
repos = priv-repos // krebs-repos // connector-repos ;
|
||||||
rules = concatMap krebs-rules (attrValues krebs-repos) ++ concatMap priv-rules (attrValues priv-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 {
|
krebs-repos = mapAttrs make-krebs-repo {
|
||||||
stockholm = {
|
stockholm = {
|
||||||
@ -19,6 +21,10 @@ let
|
|||||||
autosync = { };
|
autosync = { };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
connector-repos = mapAttrs make-priv-repo {
|
||||||
|
autosync = { };
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
# TODO move users to separate module
|
# TODO move users to separate module
|
||||||
make-priv-repo = name: { desc ? null, ... }: {
|
make-priv-repo = name: { desc ? null, ... }: {
|
||||||
@ -40,12 +46,19 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
set-owners = with git;repo: user:
|
|
||||||
singleton {
|
|
||||||
inherit user;
|
# TODO: get the list of all krebsministers
|
||||||
repo = [ repo ];
|
krebsminister = with config.krebs.users; [ lass tv uriel ];
|
||||||
perm = push "refs/*" [ non-fast-forward create delete merge ];
|
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:
|
set-ro-access = with git; repo: user:
|
||||||
optional repo.public {
|
optional repo.public {
|
||||||
@ -54,14 +67,12 @@ let
|
|||||||
perm = fetch;
|
perm = fetch;
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: get the list of all krebsministers
|
set-owners = with git;repo: user:
|
||||||
krebsminister = with config.krebs.users; [ lass tv uriel ];
|
singleton {
|
||||||
all-makefu = with config.krebs.users; [ makefu makefu-omo makefu-tsp ];
|
inherit user;
|
||||||
|
repo = [ repo ];
|
||||||
priv-rules = repo: set-owners repo all-makefu;
|
perm = push "refs/*" [ non-fast-forward create delete merge ];
|
||||||
|
};
|
||||||
krebs-rules = repo:
|
|
||||||
set-owners repo all-makefu ++ set-ro-access repo krebsminister;
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
imports = [{
|
imports = [{
|
||||||
@ -73,6 +84,11 @@ in {
|
|||||||
name = "makefu-tsp" ;
|
name = "makefu-tsp" ;
|
||||||
pubkey= with builtins; readFile ../../../krebs/Zpubkeys/makefu_tsp.ssh.pub;
|
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 = {
|
krebs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user