Author: sandervanderburg
Date: Wed Dec 22 13:32:16 2010
New Revision: 25235
URL: https://svn.nixos.org/websvn/nix/?rev=25235&sc=1

Log:
Added svnserve module, to serve Subversion repositories through the SVN protocol

Added:
   nixos/trunk/modules/services/misc/svnserve.nix
Modified:
   nixos/trunk/modules/module-list.nix

Modified: nixos/trunk/modules/module-list.nix
==============================================================================
--- nixos/trunk/modules/module-list.nix Wed Dec 22 13:31:25 2010        (r25234)
+++ nixos/trunk/modules/module-list.nix Wed Dec 22 13:32:16 2010        (r25235)
@@ -73,6 +73,7 @@
   ./services/misc/nix-gc.nix
   ./services/misc/nixos-manual.nix
   ./services/misc/rogue.nix
+  ./services/misc/svnserve.nix
   ./services/misc/synergy.nix
   ./services/misc/virtualbox.nix
   ./services/monitoring/monit.nix

Added: nixos/trunk/modules/services/misc/svnserve.nix
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ nixos/trunk/modules/services/misc/svnserve.nix      Wed Dec 22 13:32:16 
2010        (r25235)
@@ -0,0 +1,46 @@
+# SVN server
+{ config, pkgs, ... }:
+
+with pkgs.lib;
+
+let
+
+  cfg = config.services.svnserve;
+  
+in
+
+{
+
+  ###### interface
+  
+  options = {
+  
+    services.svnserve = {
+    
+      enable = mkOption {
+        default = false;
+        description = "Whether to enable svnserve to serve Subversion 
repositories through the SVN protocol.";
+      };
+      
+      svnBaseDir = mkOption {
+        default = "/repos";
+       description = "Base directory from which Subversion repositories are 
accessed.";
+      };
+    };
+    
+  };
+  
+
+  ###### implementation
+
+  config = mkIf cfg.enable {
+    jobs.svnserve = {
+      startOn = "started network-interfaces";
+      stopOn = "stopping network-interfaces";
+      
+      preStart = "mkdir -p ${cfg.svnBaseDir}";
+      
+      exec = "${pkgs.subversion}/bin/svnserve -r ${cfg.svnBaseDir} -d 
--foreground --pid-file=/var/run/svnserve.pid";
+    };
+  };
+}
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to