summary refs log tree commit diff
path: root/modules/services/misc/svnserve.nix
blob: c1acf5723d842eda5db4ea3aecf18ef595d12ff2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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";
    };
  };
}