parent
90fcd66599
commit
473ffd9eae
@ -5,6 +5,7 @@ with lib;
|
|||||||
let
|
let
|
||||||
cfg = config.services.gitolite;
|
cfg = config.services.gitolite;
|
||||||
pubkeyFile = pkgs.writeText "gitolite-admin.pub" cfg.adminPubkey;
|
pubkeyFile = pkgs.writeText "gitolite-admin.pub" cfg.adminPubkey;
|
||||||
|
hooks = lib.concatMapStrings (hook: "${hook} ") cfg.commonHooks;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
@ -30,6 +31,14 @@ in
|
|||||||
once, upon the first initialization of the Gitolite user.
|
once, upon the first initialization of the Gitolite user.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
commonHooks = mkOption {
|
||||||
|
type = types.listOf types.path;
|
||||||
|
default = [];
|
||||||
|
description = ''
|
||||||
|
A list of custom git hooks that get copied to <literal>~/.gitolite/hooks/common</literal>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -57,6 +66,10 @@ in
|
|||||||
if [ ! -d repositories ]; then
|
if [ ! -d repositories ]; then
|
||||||
gitolite setup -pk ${pubkeyFile}
|
gitolite setup -pk ${pubkeyFile}
|
||||||
fi
|
fi
|
||||||
|
if [ -n "${hooks}" ]; then
|
||||||
|
cp ${hooks} .gitolite/hooks/common/
|
||||||
|
chmod +x .gitolite/hooks/common/*
|
||||||
|
fi
|
||||||
gitolite setup # Upgrade if needed
|
gitolite setup # Upgrade if needed
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user