diff options
author | tv <tv@krebsco.de> | 2015-06-14 19:19:45 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2015-06-14 19:19:45 +0200 |
commit | 2d39c763f42ef264be571a9cd602ceb50da4abc4 (patch) | |
tree | 78a1bd09af38702fb184dbb6a25f7853bdfaa0d2 /modules/cd/default.nix | |
parent | c5d0b1df31ffa27c49da6f6fa1bc6c24008ed4bc (diff) |
host cd: add services.git
Diffstat (limited to 'modules/cd/default.nix')
-rw-r--r-- | modules/cd/default.nix | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/modules/cd/default.nix b/modules/cd/default.nix index cc63318..405c27a 100644 --- a/modules/cd/default.nix +++ b/modules/cd/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: { imports = @@ -44,6 +44,40 @@ enable = true; }; + services.git = + let + inherit (builtins) readFile; + # TODO lib should already include our stuff + inherit (import ../../lib { inherit lib; }) addNames git; + in + rec { + enable = true; + + users = addNames { + tv = { pubkey = readFile <pubkeys/tv.ssh.pub>; }; + lass = { pubkey = "xxx"; }; + makefu = { pubkey = "xxx"; }; + }; + + # TODO warn about stale repodirs + repos = addNames { + testing = { + # TODO hooks = { post-receive = ... + }; + }; + + rules = with git; with users; with repos; [ + { user = tv; + repo = testing; + perm = push master [ non-fast-forward create delete merge ]; + } + { user = [ lass makefu ]; + repo = testing; + perm = fetch; + } + ]; + }; + services.journald.extraConfig = '' SystemMaxUse=1G RuntimeMaxUse=128M |