summary refs log tree commit diff
diff options
context:
space:
mode:
authorPavel Goran <me@pvgoran.name>2017-09-23 14:56:26 +0700
committerBjørn Forsman <bjorn.forsman@gmail.com>2017-09-25 22:03:00 +0200
commitcee657f9a338cb9fa7505fd02fb69e46449da16d (patch)
treee4b77c1c8c2e626c2da8fc241eb98222bdec3e87
parentb241bcf38881be764180c66fa9c713d0d44135c5 (diff)
downloadnixpkgs-cee657f9a338cb9fa7505fd02fb69e46449da16d.tar
nixpkgs-cee657f9a338cb9fa7505fd02fb69e46449da16d.tar.gz
nixpkgs-cee657f9a338cb9fa7505fd02fb69e46449da16d.tar.bz2
nixpkgs-cee657f9a338cb9fa7505fd02fb69e46449da16d.tar.lz
nixpkgs-cee657f9a338cb9fa7505fd02fb69e46449da16d.tar.xz
nixpkgs-cee657f9a338cb9fa7505fd02fb69e46449da16d.tar.zst
nixpkgs-cee657f9a338cb9fa7505fd02fb69e46449da16d.zip
nixos/gitolite: add enableGitAnnex option
-rw-r--r--nixos/modules/services/misc/gitolite.nix19
1 files changed, 18 insertions, 1 deletions
diff --git a/nixos/modules/services/misc/gitolite.nix b/nixos/modules/services/misc/gitolite.nix
index 6bb8adeccf7..f395b9558b5 100644
--- a/nixos/modules/services/misc/gitolite.nix
+++ b/nixos/modules/services/misc/gitolite.nix
@@ -41,6 +41,15 @@ in
         '';
       };
 
+      enableGitAnnex = mkOption {
+        type = types.bool;
+        default = false;
+        description = ''
+          Enable git-annex support. Uses the <literal>extraGitoliteRc</literal> option
+          to apply the necessary configuration.
+        '';
+      };
+
       commonHooks = mkOption {
         type = types.listOf types.path;
         default = [];
@@ -75,6 +84,8 @@ in
           will need to take any customizations you may have in
           <literal>~/.gitolite.rc</literal>, convert them to appropriate Perl
           statements, add them to this option, and remove the file.
+
+          See also the <literal>enableGitAnnex</literal> option.
         '';
       };
 
@@ -124,6 +135,11 @@ in
         ''} >>"$out/gitolite.rc"
       '';
   in {
+    services.gitolite.extraGitoliteRc = optionalString cfg.enableGitAnnex ''
+      # Enable git-annex support:
+      push( @{$RC{ENABLE}}, 'git-annex-shell ua');
+    '';
+
     users.extraUsers.${cfg.user} = {
       description     = "Gitolite user";
       home            = cfg.dataDir;
@@ -198,6 +214,7 @@ in
         '';
     };
 
-    environment.systemPackages = [ pkgs.gitolite pkgs.git ];
+    environment.systemPackages = [ pkgs.gitolite pkgs.git ]
+        ++ optional cfg.enableGitAnnex pkgs.gitAndTools.git-annex;
   });
 }