3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/nixos/modules/services/networking/gdomap.nix
Artyom Shalkhakov 697982b91b gnustep: fix gdnc, gdomap
Both gdnc and gdomap seem to work.
2016-08-16 21:00:31 +00:00

54 lines
1.1 KiB
Nix

{ 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.
";
};
pidfile = mkOption {
type = types.path;
default = "/tmp/gdomap.pid";
description = "Location of the pid file for gdomap daemon";
};
};
};
#
# implementation
#
config = mkIf config.services.gdomap.enable {
# NOTE: gdomap runs as root
# TODO: extra user for gdomap?
systemd.services.gdomap = {
description = "gdomap server";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
path = [ pkgs.gnustep_base ];
serviceConfig = {
PIDFile = cfg.pidfile;
ExecStart = "@${pkgs.gnustep_base}/bin/gdomap"
+ " -d -p"
+ " -I ${cfg.pidfile}";
Restart = "always";
RestartSec = 2;
TimeoutStartSec = "30";
Type = "forking";
};
};
};
}