Convert "openfire" (problem with assertion)
svn path=/nixos/branches/fix-style/; revision=14391
This commit is contained in:
parent
8e840a7aa4
commit
e5fd3f271e
@ -479,22 +479,6 @@ in
|
||||
|
||||
};
|
||||
|
||||
openfire = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
description = "
|
||||
Whether to enable OpenFire XMPP server.
|
||||
";
|
||||
};
|
||||
usePostgreSQL = mkOption {
|
||||
default = true;
|
||||
description = "
|
||||
Whether you use PostgreSQL service for your storage back-end.
|
||||
";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
postfix = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
@ -799,6 +783,7 @@ in
|
||||
(import ../upstart-jobs/xfs.nix)
|
||||
(import ../upstart-jobs/mysql.nix)
|
||||
(import ../upstart-jobs/postgresql.nix)
|
||||
(import ../upstart-jobs/openfire.nix)
|
||||
|
||||
# nix
|
||||
(import ../upstart-jobs/nix.nix) # nix options and daemon
|
||||
|
@ -131,12 +131,6 @@ let
|
||||
inherit config;
|
||||
})
|
||||
|
||||
# OpenFire XMPP server
|
||||
++ optional config.services.openfire.enable
|
||||
(import ../upstart-jobs/openfire.nix {
|
||||
inherit config pkgs;
|
||||
})
|
||||
|
||||
# Postfix mail server.
|
||||
++ optional config.services.postfix.enable
|
||||
(import ../upstart-jobs/postfix.nix {
|
||||
|
@ -1,7 +1,36 @@
|
||||
{pkgs, config}:
|
||||
{pkgs, config, ...}:
|
||||
|
||||
assert config.services.openfire.usePostgreSQL -> config.services.postgresql.enable;
|
||||
###### interface
|
||||
let
|
||||
inherit (pkgs.lib) mkOption mkIf;
|
||||
|
||||
options = {
|
||||
services = {
|
||||
openfire = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
description = "
|
||||
Whether to enable OpenFire XMPP server.
|
||||
";
|
||||
};
|
||||
usePostgreSQL = mkOption {
|
||||
default = true;
|
||||
description = "
|
||||
Whether you use PostgreSQL service for your storage back-end.
|
||||
";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
|
||||
###### implementation
|
||||
|
||||
# FIXME (see xfs)
|
||||
# if (!(config.services.openfire.usePostgreSQL -> config.services.postgresql.enable)) then throw "openfire assertion failed" else
|
||||
let
|
||||
inherit (pkgs) jre openfire coreutils which gnugrep gawk gnused;
|
||||
|
||||
startDependency = if config.services.openfire.usePostgreSQL then
|
||||
"postgresql"
|
||||
else
|
||||
@ -10,8 +39,15 @@ let
|
||||
else
|
||||
"network-interfaces";
|
||||
in
|
||||
with pkgs;
|
||||
{
|
||||
|
||||
mkIf config.services.openfire.enable {
|
||||
require = [
|
||||
options
|
||||
];
|
||||
|
||||
|
||||
services = {
|
||||
extraJobs = [{
|
||||
name = "openfire";
|
||||
job = ''
|
||||
description "OpenFire XMPP server"
|
||||
@ -32,4 +68,6 @@ with pkgs;
|
||||
openfire start
|
||||
end script
|
||||
'';
|
||||
}];
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user