I’m wondering if there is a way to link plugins from one to another/consuming NixOS package without the need to rebuild this other package.
Example:
I like to extend keepass with plugins. For this question let’s assume I want to use the existing package keepass-keepasshttp (plugin) to extend the functionality of keepass.
What I already know:
NixOS uses fixed paths to link dependencies (Nix pills ch 6 &7). Therefore it seems to be unavoidable to rebuild/recompile keepass every time an addon should be added or removed.
The keepass package implemented a patch, which supports those plugins to be included/linked at build-time
Solution mentioned in in no. 4 ist working for me so far. But keepass has to be rebuild/recompiled into a new nixos package derivation. This is an example code:
Possible solutions?
On stackoverflow someone suggested using symlinkJoin in conjunction with a wrapper.
As far as I understand the idea behind is to modify the base package (keepass). Thus only a (smaller) customized package containing the selection of plugins must be build on the target system, leaving the keepass package untouched. (maybe I misunderstood that part??) Pidgin has implemented the symlinkJoin - but frankly I don’t understand what magic is happening there, yet.
Any other ideas to solve that case?
Or could anyone give me some hints how to implement that symlinkJoin/wrapper thing in my keepass example?
So any modifications to the plugins list changes the inputs of the derivation and requires a rebuild.
To work around this, you might be able to setup a wrapper derivation that includes the base KeePass package, and prefixes the PATH variable with the module paths. Something like this might work:
I see now that my example won’t work – the keepass source is being patched to load plugins from the defined plugin paths. Good luck with the static plugin path approach.