nixos-config/2configs/git/brain-retiolum.nix

69 lines
1.6 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
# TODO: remove tv lib :)
2015-11-17 13:55:30 +01:00
with lib;
let
repos = priv-repos // krebs-repos ;
rules = concatMap krebs-rules (attrValues krebs-repos) ++ concatMap priv-rules (attrValues priv-repos);
krebs-repos = mapAttrs make-krebs-repo {
2015-09-02 10:02:05 +02:00
brain = {
desc = "braiiiins";
};
};
priv-repos = mapAttrs make-priv-repo {
autosync = { };
};
# TODO move users to separate module
make-priv-repo = name: { desc ? null, ... }: {
inherit name desc;
public = false;
};
make-krebs-repo = with git; name: { desc ? null, ... }: {
inherit name desc;
2015-09-02 10:02:05 +02:00
public = false;
hooks = {
2015-11-17 13:55:30 +01:00
post-receive = pkgs.git-hooks.irc-announce {
nick = config.networking.hostName;
channel = "#retiolum";
2015-07-29 14:22:24 +02:00
# TODO remove the hardcoded hostname
server = "cd.retiolum";
};
};
};
2015-07-29 14:22:24 +02:00
set-owners = with git;repo: user:
singleton {
inherit user;
repo = [ repo ];
perm = push "refs/*" [ non-fast-forward create delete merge ];
};
set-ro-access = with git; repo: user:
2015-10-10 20:21:52 +02:00
singleton {
inherit user;
repo = [ repo ];
perm = fetch;
};
# TODO: get the list of all krebsministers
2015-09-02 10:02:05 +02:00
krebsminister = with config.krebs.users; [ lass tv ];
2015-08-09 15:13:01 +02:00
all-makefu = with config.krebs.users; [ makefu makefu-omo makefu-tsp ];
2015-07-29 14:22:24 +02:00
priv-rules = repo: set-owners repo all-makefu;
krebs-rules = repo:
set-owners repo all-makefu ++ set-ro-access repo krebsminister;
in {
imports = [ ];
krebs.git = {
enable = true;
2015-09-02 10:02:05 +02:00
cgit = false;
inherit repos rules;
};
}