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 {
|
2020-04-20 19:05:26 +01:00
|
|
|
type = types.bool;
|
2010-12-22 13:32:16 +00:00
|
|
|
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 {
|
2016-01-06 06:50:18 +00:00
|
|
|
systemd.services.svnserve = {
|
2016-09-10 19:12:39 +01:00
|
|
|
after = [ "network.target" ];
|
2016-01-06 06:50:18 +00:00
|
|
|
wantedBy = [ "multi-user.target" ];
|
2010-12-22 13:32:16 +00:00
|
|
|
preStart = "mkdir -p ${cfg.svnBaseDir}";
|
2018-12-19 21:38:06 +00:00
|
|
|
script = "${pkgs.subversion.out}/bin/svnserve -r ${cfg.svnBaseDir} -d --foreground --pid-file=/run/svnserve.pid";
|
2010-12-22 13:32:16 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|