nixos/gitolite: add enableGitAnnex option

authored by Pavel Goran and committed by Bjørn Forsman cee657f9 b241bcf3

+18 -1
+18 -1
nixos/modules/services/misc/gitolite.nix
··· 41 41 ''; 42 42 }; 43 43 44 + enableGitAnnex = mkOption { 45 + type = types.bool; 46 + default = false; 47 + description = '' 48 + Enable git-annex support. Uses the <literal>extraGitoliteRc</literal> option 49 + to apply the necessary configuration. 50 + ''; 51 + }; 52 + 44 53 commonHooks = mkOption { 45 54 type = types.listOf types.path; 46 55 default = []; ··· 75 84 will need to take any customizations you may have in 76 85 <literal>~/.gitolite.rc</literal>, convert them to appropriate Perl 77 86 statements, add them to this option, and remove the file. 87 + 88 + See also the <literal>enableGitAnnex</literal> option. 78 89 ''; 79 90 }; 80 91 ··· 124 135 ''} >>"$out/gitolite.rc" 125 136 ''; 126 137 in { 138 + services.gitolite.extraGitoliteRc = optionalString cfg.enableGitAnnex '' 139 + # Enable git-annex support: 140 + push( @{$RC{ENABLE}}, 'git-annex-shell ua'); 141 + ''; 142 + 127 143 users.extraUsers.${cfg.user} = { 128 144 description = "Gitolite user"; 129 145 home = cfg.dataDir; ··· 198 214 ''; 199 215 }; 200 216 201 - environment.systemPackages = [ pkgs.gitolite pkgs.git ]; 217 + environment.systemPackages = [ pkgs.gitolite pkgs.git ] 218 + ++ optional cfg.enableGitAnnex pkgs.gitAndTools.git-annex; 202 219 }); 203 220 }