diff --git a/etc/profile.sh b/etc/profile.sh index 5bbe4ab97a1..b6ba962efe6 100644 --- a/etc/profile.sh +++ b/etc/profile.sh @@ -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 diff --git a/system/options.nix b/system/options.nix index 5d4128231f7..81e4ec9efbf 100644 --- a/system/options.nix +++ b/system/options.nix @@ -1084,5 +1084,90 @@ Used Gateway6 server. "; } - + + { + 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 = ""; + example = ""; + 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. +"; + } + ] diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index 0b16a98cf5d..f1e0a2e959f 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -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"] diff --git a/upstart-jobs/gw6c.nix b/upstart-jobs/gw6c.nix index 812d4081bab..4304846a807 100644 --- a/upstart-jobs/gw6c.nix +++ b/upstart-jobs/gw6c.nix @@ -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 { diff --git a/upstart-jobs/ircd-hybrid.nix b/upstart-jobs/ircd-hybrid.nix new file mode 100644 index 00000000000..7de44f55db3 --- /dev/null +++ b/upstart-jobs/ircd-hybrid.nix @@ -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 +"; +}