2014-07-17 11:51:17 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.phd;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
services.phd = {
|
|
|
|
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "
|
|
|
|
Enable daemons for phabricator.
|
|
|
|
";
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
|
|
|
systemd.services.phd = {
|
|
|
|
path = [ pkgs.phabricator pkgs.php pkgs.mercurial pkgs.git pkgs.subversion ];
|
|
|
|
|
|
|
|
after = [ "httpd.service" ];
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${pkgs.phabricator}/phabricator/bin/phd start";
|
2014-09-03 12:47:53 +01:00
|
|
|
ExecStop = "${pkgs.phabricator}/phabricator/bin/phd stop";
|
2014-07-17 11:51:17 +01:00
|
|
|
User = "wwwrun";
|
|
|
|
RestartSec = "30s";
|
|
|
|
Restart = "always";
|
|
|
|
StartLimitInterval = "1m";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|