Added short keep-alive period to gw6c, added ircd-hybrid service.

svn path=/nixos/trunk/; revision=9071
This commit is contained in:
Michael Raskin 2007-08-08 20:42:25 +00:00
parent 8843f3c287
commit bb25a6ef96
5 changed files with 132 additions and 2 deletions

View File

@ -1,6 +1,7 @@
export PATH=@wrapperDir@:/var/run/current-system/sw/bin:/var/run/current-system/sw/sbin
export MODULE_DIR=@kernel@/lib/modules
export NIX_CONF_DIR=/nix/etc/nix
export NIXPKGS_CONFIG=/nix/etc/config.nix
export PAGER=less
export TZ=@timeZone@
export TZDIR=@glibc@/share/zoneinfo

View File

@ -1085,4 +1085,89 @@
";
}
{
name = ["services" "gw6c" "keepAlive"];
default = "30";
example = "2";
description = "
Gateway6 keep-alive period.
";
}
{
name = ["services" "ircdHybrid" "enable"];
default = false;
description = "
Enable IRCD.
";
}
{
name = ["services" "ircdHybrid" "serverName"];
default = "hades.arpa";
description = "
IRCD server name.
";
}
{
name = ["services" "ircdHybrid" "sid"];
default = "0NL";
description = "
IRCD server unique ID in a net of servers.
";
}
{
name = ["services" "ircdHybrid" "description"];
default = "Hybrid-7 IRC server.";
description = "
IRCD server description.
";
}
{
name = ["services" "ircdHybrid" "rsaKey"];
default = null;
example = /root/certificates/irc.key;
description = "
IRCD server RSA key.
";
}
{
name = ["services" "ircdHybrid" "certificate"];
default = null;
example = /root/certificates/irc.pem;
description = "
IRCD server SSL certificate. There are some limitations - read manual.
";
}
{
name = ["services" "ircdHybrid" "adminEmail"];
default = "<bit-bucket@example.com>";
example = "<name@domain.tld>";
description = "
IRCD server administrator e-mail.
";
}
{
name = ["services" "ircdHybrid" "extraIPs"];
default = [];
example = ["127.0.0.1"];
description = "
Extra IP's to bind.
";
}
{
name = ["services" "ircdHybrid" "extraPort"];
default = "7117";
description = "
Extra port to avoid filtering.
";
}
]

View File

@ -183,6 +183,11 @@ import ../upstart-jobs/gather.nix {
inherit config pkgs;
})
++ optional ["services" "ircdHybrid" "enable"]
(import ../upstart-jobs/ircd-hybrid.nix {
inherit config pkgs;
})
# ALSA sound support.
++ optional ["sound" "enable"]

View File

@ -4,10 +4,12 @@ let
procps = pkgs.procps;
gw6cService = import ../services/gw6c {
inherit (pkgs) stdenv gw6c coreutils
procps upstart nettools;
procps upstart iputils gnused
gnugrep;
username = getCfg "username";
password = getCfg "password";
server = getCfg "server";
keepAlive = getCfg "keepAlive";
};
in
{

View File

@ -0,0 +1,37 @@
{config, pkgs}:
let
getCfg = option: config.get ["services" "ircdHybrid" option];
ircdService = import ../services/ircd-hybrid {
stdenv = pkgs.stdenvNewSetupScript;
inherit (pkgs) ircdHybrid coreutils
su;
serverName = getCfg "serverName";
sid = getCfg "sid";
description = getCfg "description";
rsaKey = getCfg "rsaKey";
certificate = getCfg "certificate";
adminEmail = getCfg "adminEmail";
extraIPs = getCfg "extraIPs";
extraPort = getCfg "extraPort";
};
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
";
}