2014-12-13 16:48:39 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.gdomap;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
#
|
|
|
|
# interface
|
|
|
|
#
|
|
|
|
options = {
|
|
|
|
services.gdomap = {
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "
|
|
|
|
Whether to enable gdomap, the GNUstep distributed objects daemon.
|
|
|
|
|
|
|
|
Note that gdomap runs as root.
|
|
|
|
";
|
|
|
|
};
|
2015-01-29 15:56:26 +00:00
|
|
|
|
|
|
|
pidfile = mkOption {
|
|
|
|
type = types.path;
|
|
|
|
default = "/tmp/gdomap.pid";
|
|
|
|
description = "Location of the pid file for gdomap daemon";
|
2015-01-25 16:34:52 +00:00
|
|
|
};
|
2014-12-13 16:48:39 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
#
|
|
|
|
# implementation
|
|
|
|
#
|
|
|
|
config = mkIf config.services.gdomap.enable {
|
|
|
|
# NOTE: gdomap runs as root
|
2015-01-25 16:34:52 +00:00
|
|
|
# TODO: extra user for gdomap?
|
2014-12-13 16:48:39 +00:00
|
|
|
systemd.services.gdomap = {
|
|
|
|
description = "gdomap server";
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
after = [ "network.target" ];
|
|
|
|
path = [ pkgs.gnustep_base ];
|
|
|
|
serviceConfig = {
|
2015-01-29 15:56:26 +00:00
|
|
|
PIDFile = cfg.pidfile;
|
2014-12-13 16:48:39 +00:00
|
|
|
ExecStart = "@${pkgs.gnustep_base}/bin/gdomap"
|
2015-01-25 16:34:52 +00:00
|
|
|
+ " -d -p"
|
2015-01-29 15:56:26 +00:00
|
|
|
+ " -I ${cfg.pidfile}";
|
2015-01-25 16:34:52 +00:00
|
|
|
Restart = "always";
|
2014-12-13 16:48:39 +00:00
|
|
|
RestartSec = 2;
|
|
|
|
TimeoutStartSec = "30";
|
|
|
|
Type = "forking";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2015-01-29 15:56:26 +00:00
|
|
|
}
|