2007-08-08 20:42:25 +00:00
|
|
|
{config, pkgs}:
|
|
|
|
let
|
|
|
|
getCfg = option: config.get ["services" "ircdHybrid" option];
|
|
|
|
ircdService = import ../services/ircd-hybrid {
|
|
|
|
stdenv = pkgs.stdenvNewSetupScript;
|
|
|
|
inherit (pkgs) ircdHybrid coreutils
|
2007-08-13 10:45:16 +00:00
|
|
|
su iproute gnugrep procps;
|
2007-08-08 20:42:25 +00:00
|
|
|
serverName = getCfg "serverName";
|
|
|
|
sid = getCfg "sid";
|
|
|
|
description = getCfg "description";
|
|
|
|
rsaKey = getCfg "rsaKey";
|
|
|
|
certificate = getCfg "certificate";
|
|
|
|
adminEmail = getCfg "adminEmail";
|
|
|
|
extraIPs = getCfg "extraIPs";
|
|
|
|
extraPort = getCfg "extraPort";
|
2007-08-10 18:52:35 +00:00
|
|
|
gw6cEnabled = config.get ["services" "gw6c" "enable"];
|
2007-08-08 20:42:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
startingDependency = if (config.get [ "services" "gw6c" "enable" ])
|
|
|
|
then "gw6c" else "network-interfaces";
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
name = "ircd-hybrid";
|
|
|
|
users = [ {
|
|
|
|
name = "ircd";
|
|
|
|
description = "IRCD owner.";
|
|
|
|
} ];
|
|
|
|
groups = [{name = "ircd";}];
|
|
|
|
job = "
|
|
|
|
description = \"IRCD Hybrid server.\"
|
|
|
|
|
|
|
|
start on ${startingDependency}/started
|
|
|
|
stop on ${startingDependency}/stop
|
|
|
|
|
|
|
|
respawn ${ircdService}/bin/control start
|
|
|
|
";
|
|
|
|
}
|