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 {
|
2020-04-20 20:05:26 +02:00
|
|
|
type = types.bool;
|
2010-12-22 14:32:16 +01:00
|
|
|
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 {
|
2021-01-31 12:15:45 +01:00
|
|
|
type = types.str;
|
2010-12-22 14:32:16 +01:00
|
|
|
default = "/repos";
|
2020-11-22 08:23:53 +01:00
|
|
|
description = "Base directory from which Subversion repositories are accessed.";
|
2010-12-22 14:32:16 +01:00
|
|
|
};
|
|
|
|
};
|
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 {
|
2016-01-06 07:50:18 +01:00
|
|
|
systemd.services.svnserve = {
|
2016-09-10 20:12:39 +02:00
|
|
|
after = [ "network.target" ];
|
2016-01-06 07:50:18 +01:00
|
|
|
wantedBy = [ "multi-user.target" ];
|
2010-12-22 14:32:16 +01:00
|
|
|
preStart = "mkdir -p ${cfg.svnBaseDir}";
|
2018-12-19 22:38:06 +01:00
|
|
|
script = "${pkgs.subversion.out}/bin/svnserve -r ${cfg.svnBaseDir} -d --foreground --pid-file=/run/svnserve.pid";
|
2010-12-22 14:32:16 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|