* Move ircd-hybrid stuff from the services tree to the nixos tree.
svn path=/nixos/trunk/; revision=27009
This commit is contained in:
parent
3ae283e8c3
commit
6739162d9a
|
@ -51,11 +51,11 @@
|
|||
./services/backup/mysql-backup.nix
|
||||
./services/backup/postgresql-backup.nix
|
||||
./services/backup/sitecopy-backup.nix
|
||||
./services/databases/4store.nix
|
||||
./services/databases/4store-endpoint.nix
|
||||
./services/databases/4store.nix
|
||||
./services/databases/mysql.nix
|
||||
./services/databases/postgresql.nix
|
||||
./services/databases/openldap.nix
|
||||
./services/databases/postgresql.nix
|
||||
./services/games/ghost-one.nix
|
||||
./services/hardware/acpid.nix
|
||||
./services/hardware/bluetooth.nix
|
||||
|
@ -103,7 +103,7 @@
|
|||
./services/networking/gvpe.nix
|
||||
./services/networking/gw6c/default.nix
|
||||
./services/networking/ifplugd.nix
|
||||
#./services/networking/ircd-hybrid.nix
|
||||
./services/networking/ircd-hybrid/default.nix
|
||||
./services/networking/nat.nix
|
||||
./services/networking/ntpd.nix
|
||||
./services/networking/openfire.nix
|
||||
|
|
31
modules/services/networking/ircd-hybrid/builder.sh
Normal file
31
modules/services/networking/ircd-hybrid/builder.sh
Normal file
|
@ -0,0 +1,31 @@
|
|||
source $stdenv/setup
|
||||
|
||||
doSub() {
|
||||
local src=$1
|
||||
local dst=$2
|
||||
ensureDir $(dirname $dst)
|
||||
substituteAll $src $dst
|
||||
}
|
||||
|
||||
subDir=/
|
||||
for i in $scripts; do
|
||||
if test "$(echo $i | cut -c1-2)" = "=>"; then
|
||||
subDir=$(echo $i | cut -c3-)
|
||||
else
|
||||
dst=$out/$subDir/$((stripHash $i; echo $strippedName) | sed 's/\.in//')
|
||||
doSub $i $dst
|
||||
chmod +x $dst # !!!
|
||||
fi
|
||||
done
|
||||
|
||||
subDir=/
|
||||
for i in $substFiles; do
|
||||
if test "$(echo $i | cut -c1-2)" = "=>"; then
|
||||
subDir=$(echo $i | cut -c3-)
|
||||
else
|
||||
dst=$out/$subDir/$((stripHash $i; echo $strippedName) | sed 's/\.in//')
|
||||
doSub $i $dst
|
||||
fi
|
||||
done
|
||||
|
||||
ensureDir $out/bin
|
26
modules/services/networking/ircd-hybrid/control.in
Normal file
26
modules/services/networking/ircd-hybrid/control.in
Normal file
|
@ -0,0 +1,26 @@
|
|||
#! @shell@ -e
|
||||
|
||||
# Make sure that the environment is deterministic.
|
||||
export PATH=@coreutils@/bin
|
||||
|
||||
if test "$1" = "start"; then
|
||||
if ! @procps@/bin/pgrep ircd; then
|
||||
if @gw6cEnabled@; then
|
||||
while ! @iproute@/sbin/ip addr |
|
||||
@gnugrep@/bin/grep inet6 |
|
||||
@gnugrep@/bin/grep global; do
|
||||
sleep 1;
|
||||
done;
|
||||
fi;
|
||||
rm -rf /home/ircd
|
||||
mkdir -p /home/ircd
|
||||
chown ircd: /home/ircd
|
||||
cd /home/ircd
|
||||
env - HOME=/homeless-shelter $extraEnv \
|
||||
@su@/bin/su ircd --shell=/bin/sh -c ' @ircdHybrid@/bin/ircd -configfile @out@/conf/ircd.conf </dev/null -logfile /home/ircd/ircd.log' 2>&1 >/var/log/ircd-hybrid.out
|
||||
fi;
|
||||
fi
|
||||
|
||||
if test "$1" = "stop" ; then
|
||||
@procps@/bin/pkill ircd;
|
||||
fi;
|
|
@ -1,4 +1,4 @@
|
|||
{ config, pkgs, servicesPath, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
|
||||
|
@ -6,19 +6,24 @@ let
|
|||
|
||||
cfg = config.services.ircdHybrid;
|
||||
|
||||
ircdService = import (servicesPath + /ircd-hybrid) {
|
||||
stdenv = pkgs.stdenv;
|
||||
inherit (pkgs) ircdHybrid coreutils
|
||||
su iproute gnugrep procps;
|
||||
serverName = cfg.serverName;
|
||||
sid = cfg.sid;
|
||||
description = cfg.description;
|
||||
rsaKey = cfg.rsaKey;
|
||||
certificate = cfg.certificate;
|
||||
adminEmail = cfg.adminEmail;
|
||||
extraIPs = cfg.extraIPs;
|
||||
extraPort = cfg.extraPort;
|
||||
gw6cEnabled = config.services.gw6c.enable && config.services.gw6c.autorun;
|
||||
ircdService = pkgs.stdenv.mkDerivation {
|
||||
name = "ircd-hybrid-service";
|
||||
scripts = [ "=>/bin" ./control.in ];
|
||||
substFiles = [ "=>/conf" ./ircd.conf ];
|
||||
inherit (pkgs) ircdHybrid coreutils su iproute gnugrep procps;
|
||||
|
||||
gw6cEnabled = if config.services.gw6c.enable && config.services.gw6c.autorun then "true" else "false";
|
||||
|
||||
inherit (cfg) serverName sid description adminEmail
|
||||
extraPort;
|
||||
|
||||
cryptoSettings =
|
||||
(optionalString (cfg.rsaKey != null) "rsa_private_key_file = \"${cfg.rsaKey}\";\n") +
|
||||
(optionalString (cfg.certificate != null) "ssl_certificate_file = \"${cfg.certificate}\";\n");
|
||||
|
||||
extraListen = map (ip: "host = \""+ip+"\";\nport = 6665 .. 6669, "+extraPort+"; ") cfg.extraIPs;
|
||||
|
||||
builder = ./builder.sh;
|
||||
};
|
||||
|
||||
startingDependency = if config.services.gw6c.enable then "gw6c" else "network-interfaces";
|
||||
|
@ -118,7 +123,7 @@ in
|
|||
{ name = "ircd"; };
|
||||
|
||||
jobs.ircd_hybrid =
|
||||
{ # name = "ircd-hybrid"; !!! mkIf bug
|
||||
{ name = "ircd-hybrid";
|
||||
|
||||
description = "IRCD Hybrid server";
|
||||
|
1051
modules/services/networking/ircd-hybrid/ircd.conf
Normal file
1051
modules/services/networking/ircd-hybrid/ircd.conf
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue