I also added a patch that makes dovecot search for
plugins in /var/lib/dovecot/modules. This way, you
can add plugins from several packages without running
into circular dependencies. The module dir needs to
be populated before the dovecot service is started,
for example. This is currently not done in NixOS, so
you need to implement your own service in order to
get the plugins working.
The module patch has not been added to the old 2.1.x
package.