Elastic search plugins

There is config option for services.elasticsearch.plugins which takes “list of derivations”.
What I am expected provide there and what would be most easy way to list all possible values?

I would very much appreciate if any of you could tell me howto reference any non “top level” package/derivation.

$ nix search elasticsearchplugins
warning: using cached results; pass '-u' to update the cache
* elasticsearchPlugins.discovery-ec2 (elasticsearch-discovery-ec2-6.5.1)
  The EC2 discovery plugin uses the AWS API for unicast discovery.

* elasticsearchPlugins.elasticsearch_analysis_lemmagen (elasticsearch-analysis-lemmagen-6.5.1)
  LemmaGen Analysis plugin provides jLemmaGen lemmatizer as Elasticsearch token filter

* elasticsearchPlugins.search_guard (elastic-search-guard-6.5.1-23.2)
  Plugin to fetch data from JDBC sources for indexing into Elasticsearch

I’ve also opened PR to add an example of plugins usage into NixOS manual. But I don’t want to merge it yet, because plugin from example doesn’t build for me.

How to add a custom plugin?
I wanted to add “ingest-attachement” needed by elastic search plugin to nextcloud.

Where is elasticsearchPlugins even defined? Strangely I can only find it referenced with nixos/modules/services/search/elasticsearch.nix according to github.

https://github.com/NixOS/nixpkgs/blob/fb6260fcf7c126619962978b366f230cd61afe3e/pkgs/servers/search/elasticsearch/plugins.nix

or

nix search elasticsearchPlugins