mongooseim: Add a small Erlang expression library.

This is going to be used for escaping values and/or in the future we
might want to even pretty-print values. But for now the library consists
of an attribute set with erl<TYPE> functions that do the necessary
escaping and one erlType function that can be used for mkOption's type
attribute.

The latter expects one argument, which is the type of the outermost
erlang expression. That way, we even have lightweight type checking for
Erlang expressions in Nix.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Use mkEnableOption in all services.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
services/mongooseim: Add listener configuration.

This now allows us to configure listeners and their corresponding
modules. Options for those modules allow arbitrary Erlang terms within
a list, thus the erlexpr library in the previous commit.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
services/mongooseim: Add options for vhosts.

Or to be better called: For any "hosting" at all, because even the main
hostname wasn't set before.

Now, the default config should work out of the box, but there are still
a lot of configuration values that are still missing.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
services/mongooseim: Use erlexpr lib in settings.

This should ensure that we get proper escaping of Erlang values.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
services/mongooseim: Add authMethod option.

Unfortunately at the moment it's not possible to configure ODBC, LDAP,
PAM and whatnot, because the corresponding auth options are missing.

It's very likely that these options will be missing in the future
because the only backend that we're interested in is Mnesia.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
services/mongooseim: Add an extraConfig option.

This allows to insert arbitrary values into the config, so we can switch
at least half of the configuration file of the tests to the new
configuration scheme.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
tests/mongooseim: Switch to new settings system.

Well, at least half of it, because the new settings system isn't quite
complete yet. Also, we needed to copy & paste the listener configuration
again, which is quite a bit redundant and shouldn't be necessary.

In the finished state it should be possible to override single options
of a particular listener, without the need to add the whole listener
again.

One particular issue here is that we can't easily unique together
multiple attributes in that option list, so we might want to switch to a
types.loaOf maybe?

Signed-off-by: aszlig <aszlig@redmoonstudios.org>