Add gitolite
This commit is contained in:
parent
f9c3ecb144
commit
151500dba3
3 changed files with 32 additions and 0 deletions
|
@ -72,6 +72,7 @@ m-0 = {
|
||||||
# dropbearkey -t rsa -f /etc/nixos/hosts/<hostname>/secret/boot_rsa
|
# dropbearkey -t rsa -f /etc/nixos/hosts/<hostname>/secret/boot_rsa
|
||||||
server.enable = true;
|
server.enable = true;
|
||||||
standalone.enable = true;
|
standalone.enable = true;
|
||||||
|
git-server.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users."${me.user}" = (import ./home.nix);
|
home-manager.users."${me.user}" = (import ./home.nix);
|
||||||
|
|
|
@ -6,6 +6,7 @@ in {
|
||||||
<home-manager/nixos>
|
<home-manager/nixos>
|
||||||
../common
|
../common
|
||||||
./modules/laptop.nix
|
./modules/laptop.nix
|
||||||
|
./modules/git-server.nix
|
||||||
./modules/server
|
./modules/server
|
||||||
./modules/standalone
|
./modules/standalone
|
||||||
"${builtins.fetchGit "ssh://git@git.darmstadt.ccc.de/cdark.net/nixdark"}/default.nix"
|
"${builtins.fetchGit "ssh://git@git.darmstadt.ccc.de/cdark.net/nixdark"}/default.nix"
|
||||||
|
|
30
system/modules/git-server.nix
Normal file
30
system/modules/git-server.nix
Normal 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
|
||||||
|
'') ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue