The default HTML templates for the web-based modules1 depend on the Bootstrap 4 CSS and JavaScript libraries, and the jQuery library. They expect these to be available at https://example.com/share.
An easy way to provide theam instead if you are on Debian 10 (buster) is to enable mod_http_libjs and install the following packages:
apt install libjs-bootstrap4 libjs-jquery
On other systems you will need to manually fetch and put these libraries somewhere on the filesystem that Prosody can read, and serve them using mod_http_libjs with a custom libjs_path setting.
You could try putting the files on a reverse proxy in front of the XMPP server, but I can’t say I know much about this particular situation or why they thought they needed jQuery or Bootstrap dependencies for this task… 1. who knows what version the host really comes with, 2. we can see they vendored QR code scanning + UA detection already, & 3. there really isn’t much code to begin with so it is such a huge dependency (4. there practices too that look like HTML dev from last decade).
Seems like the right idea to cache these versions yourself but code looks a bit messy with that jquery just floating in the derivation like it is. It’s probable srcs (not src) could make this in a single mkDerivation. You can also switch to stdenvNoCC over stdenv since you don’t need a C compiler, but you likely could just runCommand & cp your srcs to $out. I also don’t think you need every version of jquery instead of just jquery.min.js (or rename the one you want to the name the module is looking for). Current (not using srcs) installPhase could probably shorter like