1
0
Fork 0

Add gitolite

This commit is contained in:
Malte Brandy 2019-02-06 11:46:33 +01:00
parent f9c3ecb144
commit 151500dba3
3 changed files with 32 additions and 0 deletions

View file

@ -72,6 +72,7 @@ m-0 = {
# dropbearkey -t rsa -f /etc/nixos/hosts/<hostname>/secret/boot_rsa
server.enable = true;
standalone.enable = true;
git-server.enable = true;
};
home-manager.users."${me.user}" = (import ./home.nix);

View file

@ -6,6 +6,7 @@ in {
<home-manager/nixos>
../common
./modules/laptop.nix
./modules/git-server.nix
./modules/server
./modules/standalone
"${builtins.fetchGit "ssh://git@git.darmstadt.ccc.de/cdark.net/nixdark"}/default.nix"

View file

@ -0,0 +1,30 @@
{ config, pkgs, lib, ... }:
with lib;
let
me = config.m-0.private.me;
in
{
options = {
m-0.git-server.enable = mkOption {
type = types.bool;
default = false;
};
};
config = mkIf config.m-0.git-server.enable {
services.gitolite = {
enable = true;
user = "git";
adminPubkey = builtins.elemAt me.keys 0;
extraGitoliteRc = ''
$RC{AUTH_OPTIONS} = 'no-port-forwarding,no-X11-forwarding,no-pty';
'';
commonHooks = [ (builtins.toFile "post-update" ''
[ -z $GL_OPTION_MIRROR ] && exit
git push --all $GL_OPTION_MIRROR
'') ];
};
};
}