Making plugin section for libreoffice

I’m working on including some optional templates for LibreOffice Impress as mentioned here: libreoffice: Templates for LibreOffice Impress by LouisDK1 · Pull Request #94753 · NixOS/nixpkgs · GitHub

I personally would prefer a package called “libreofficePlugins.impress-templates” making room for more plugins at a later time.

I’m a bit stuck on this as different packages write there plugins.nix in a different way.
I’ve looked a several plugins.nix (eg. from kodi, deadbeef and chromium) but have yet to find a proper way.

My plan is to do a “callPackage” for libreofficePlugins in either all-packages.nix or default.nix for libreoffice and then the user can specify to build all plugins or just impress-templates and by default none would get build.

A link to an inspirational plugins.nix or a hint in the right direction would be very appreciated.

I’ve updated the PR and plugins.nix

I need to make the templates available for LibreOffice Impress.

I’ve tried these paths:

mkdir -p $out/share/libreoffice-impress-templates/template/common/presnt/

install -vDm755 *.otp $out/share/libreoffice-impress-templates/template/common/presnt/

And these:

mkdir -p $out/share/libreoffice/template/common/presnt/

install -vDm755 *.otp $out/share/libreoffice/template/common/presnt/

And lastly this:
mkdir -p $out/lib/libreoffice/share/template/common/presnt/
install -vDm755 *.otp $out/lib/libreoffice/share/template/common/presnt/

But I need a way to the the path passed to “stat” when LibreOffice Impress is started.

I can see that wrapper.sh has references to hunspell but wrapper.sh will get driven before the templates get installed so I’m a little lost.