2008-03-03 20:28:10 +01:00
|
|
|
{pkgs, config}:
|
|
|
|
|
|
|
|
assert config.services.openfire.usePostgreSQL -> config.services.postgresql.enable;
|
|
|
|
let
|
|
|
|
startDependency = if config.services.openfire.usePostgreSQL then
|
|
|
|
"postgresql"
|
|
|
|
else
|
|
|
|
if config.services.gw6c.enable then
|
|
|
|
"gw6c"
|
|
|
|
else
|
|
|
|
"network-interfaces";
|
|
|
|
in
|
|
|
|
with pkgs;
|
|
|
|
{
|
|
|
|
name = "openfire";
|
|
|
|
job = ''
|
|
|
|
description "OpenFire XMPP server"
|
|
|
|
|
|
|
|
start on ${startDependency}/started
|
|
|
|
stop on shutdown
|
|
|
|
|
|
|
|
script
|
|
|
|
export PATH=${jre}/bin:${openfire}/bin:${coreutils}/bin:${which}/bin:${gnugrep}/bin:${gawk}/bin:${gnused}/bin
|
|
|
|
export HOME=/tmp
|
2008-03-22 18:54:13 +01:00
|
|
|
mkdir /var/log/openfire || true
|
|
|
|
mkdir /etc/openfire || true
|
|
|
|
for i in ${openfire}/conf.inst/*; do
|
|
|
|
if ! test -f /etc/openfire/$(basename $i); then
|
2008-07-23 16:13:27 +02:00
|
|
|
cp $i /etc/openfire/
|
|
|
|
fi
|
2008-03-22 18:54:13 +01:00
|
|
|
done
|
2008-03-03 20:28:10 +01:00
|
|
|
openfire start
|
|
|
|
end script
|
|
|
|
'';
|
|
|
|
}
|