at 15.09-beta 847 B view raw
1# SVN server 2{ config, lib, pkgs, ... }: 3 4with lib; 5 6let 7 8 cfg = config.services.svnserve; 9 10in 11 12{ 13 14 ###### interface 15 16 options = { 17 18 services.svnserve = { 19 20 enable = mkOption { 21 default = false; 22 description = "Whether to enable svnserve to serve Subversion repositories through the SVN protocol."; 23 }; 24 25 svnBaseDir = mkOption { 26 default = "/repos"; 27 description = "Base directory from which Subversion repositories are accessed."; 28 }; 29 }; 30 31 }; 32 33 34 ###### implementation 35 36 config = mkIf cfg.enable { 37 jobs.svnserve = { 38 startOn = "started network-interfaces"; 39 stopOn = "stopping network-interfaces"; 40 41 preStart = "mkdir -p ${cfg.svnBaseDir}"; 42 43 exec = "${pkgs.subversion}/bin/svnserve -r ${cfg.svnBaseDir} -d --foreground --pid-file=/var/run/svnserve.pid"; 44 }; 45 }; 46}