aboutsummaryrefslogtreecommitdiff
path: root/virtual/modules/gitolite.nix
diff options
context:
space:
mode:
Diffstat (limited to 'virtual/modules/gitolite.nix')
-rw-r--r--virtual/modules/gitolite.nix21
1 files changed, 16 insertions, 5 deletions
diff --git a/virtual/modules/gitolite.nix b/virtual/modules/gitolite.nix
index 85c7be1..d6b9c79 100644
--- a/virtual/modules/gitolite.nix
+++ b/virtual/modules/gitolite.nix
@@ -4,6 +4,10 @@ let
4in { 4in {
5 options.services.myGitolite = { 5 options.services.myGitolite = {
6 enable = lib.mkEnableOption "my gitolite service"; 6 enable = lib.mkEnableOption "my gitolite service";
7 gitoliteDir = lib.mkOption {
8 type = lib.types.string;
9 default = "/var/lib/gitolite";
10 };
7 }; 11 };
8 12
9 config = lib.mkIf cfg.enable { 13 config = lib.mkIf cfg.enable {
@@ -20,6 +24,13 @@ in {
20 }); 24 });
21 }; 25 };
22 26
27 services.gitDaemon = {
28 enable = true;
29 user = "gitolite";
30 group = "gitolite";
31 basePath = "${cfg.gitoliteDir}/repositories";
32 };
33
23 system.activationScripts.gitolite = 34 system.activationScripts.gitolite =
24 assert mylibs.checkEnv "NIXOPS_GITOLITE_LDAP_PASSWORD"; 35 assert mylibs.checkEnv "NIXOPS_GITOLITE_LDAP_PASSWORD";
25 let 36 let
@@ -34,12 +45,12 @@ in {
34 in { 45 in {
35 deps = [ "users" ]; 46 deps = [ "users" ];
36 text = '' 47 text = ''
37 if [ -d /var/lib/gitolite ]; then 48 if [ -d ${cfg.gitoliteDir} ]; then
38 ln -sf ${gitolite_ldap_groups} /var/lib/gitolite/gitolite_ldap_groups.sh 49 ln -sf ${gitolite_ldap_groups} ${cfg.gitoliteDir}/gitolite_ldap_groups.sh
39 chmod g+rx /var/lib/gitolite 50 chmod g+rx ${cfg.gitoliteDir}
40 fi 51 fi
41 if [ -f /var/lib/gitolite/projects.list ]; then 52 if [ -f ${cfg.gitoliteDir}/projects.list ]; then
42 chmod g+r /var/lib/gitolite/projects.list 53 chmod g+r ${cfg.gitoliteDir}/projects.list
43 fi 54 fi
44 ''; 55 '';
45 }; 56 };