2010-12-22 13:32:16 +00:00
|
|
|
# SVN server
|
2014-04-14 15:26:48 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
2010-12-22 13:32:16 +00:00
|
|
|
|
2014-04-14 15:26:48 +01:00
|
|
|
with lib;
|
2010-12-22 13:32:16 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.svnserve;
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2010-12-22 13:32:16 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2010-12-22 13:32:16 +00:00
|
|
|
options = {
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2010-12-22 13:32:16 +00:00
|
|
|
services.svnserve = {
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2010-12-22 13:32:16 +00:00
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "Whether to enable svnserve to serve Subversion repositories through the SVN protocol.";
|
|
|
|
};
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2010-12-22 13:32:16 +00:00
|
|
|
svnBaseDir = mkOption {
|
|
|
|
default = "/repos";
|
|
|
|
description = "Base directory from which Subversion repositories are accessed.";
|
|
|
|
};
|
|
|
|
};
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2010-12-22 13:32:16 +00:00
|
|
|
};
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2010-12-22 13:32:16 +00:00
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
jobs.svnserve = {
|
|
|
|
startOn = "started network-interfaces";
|
|
|
|
stopOn = "stopping network-interfaces";
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2010-12-22 13:32:16 +00:00
|
|
|
preStart = "mkdir -p ${cfg.svnBaseDir}";
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2015-10-26 10:30:48 +00:00
|
|
|
exec = "${pkgs.subversion.out}/bin/svnserve -r ${cfg.svnBaseDir} -d --foreground --pid-file=/var/run/svnserve.pid";
|
2010-12-22 13:32:16 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|