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