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 = {
|
postfix = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
@ -799,6 +783,7 @@ in
|
|||||||
(import ../upstart-jobs/xfs.nix)
|
(import ../upstart-jobs/xfs.nix)
|
||||||
(import ../upstart-jobs/mysql.nix)
|
(import ../upstart-jobs/mysql.nix)
|
||||||
(import ../upstart-jobs/postgresql.nix)
|
(import ../upstart-jobs/postgresql.nix)
|
||||||
|
(import ../upstart-jobs/openfire.nix)
|
||||||
|
|
||||||
# nix
|
# nix
|
||||||
(import ../upstart-jobs/nix.nix) # nix options and daemon
|
(import ../upstart-jobs/nix.nix) # nix options and daemon
|
||||||
|
@ -131,12 +131,6 @@ let
|
|||||||
inherit config;
|
inherit config;
|
||||||
})
|
})
|
||||||
|
|
||||||
# OpenFire XMPP server
|
|
||||||
++ optional config.services.openfire.enable
|
|
||||||
(import ../upstart-jobs/openfire.nix {
|
|
||||||
inherit config pkgs;
|
|
||||||
})
|
|
||||||
|
|
||||||
# Postfix mail server.
|
# Postfix mail server.
|
||||||
++ optional config.services.postfix.enable
|
++ optional config.services.postfix.enable
|
||||||
(import ../upstart-jobs/postfix.nix {
|
(import ../upstart-jobs/postfix.nix {
|
||||||
|
@ -1,7 +1,36 @@
|
|||||||
{pkgs, config}:
|
{pkgs, config, ...}:
|
||||||
|
|
||||||
assert config.services.openfire.usePostgreSQL -> config.services.postgresql.enable;
|
###### interface
|
||||||
let
|
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
|
startDependency = if config.services.openfire.usePostgreSQL then
|
||||||
"postgresql"
|
"postgresql"
|
||||||
else
|
else
|
||||||
@ -10,8 +39,15 @@ let
|
|||||||
else
|
else
|
||||||
"network-interfaces";
|
"network-interfaces";
|
||||||
in
|
in
|
||||||
with pkgs;
|
|
||||||
{
|
mkIf config.services.openfire.enable {
|
||||||
|
require = [
|
||||||
|
options
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
services = {
|
||||||
|
extraJobs = [{
|
||||||
name = "openfire";
|
name = "openfire";
|
||||||
job = ''
|
job = ''
|
||||||
description "OpenFire XMPP server"
|
description "OpenFire XMPP server"
|
||||||
@ -32,4 +68,6 @@ with pkgs;
|
|||||||
openfire start
|
openfire start
|
||||||
end script
|
end script
|
||||||
'';
|
'';
|
||||||
|
}];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user