Aspell will search for dictionaries in all nix profiles even when used as library.
Setting data-dir or dict-dir in ASPELL_CONF will disable this behavior.
In c0cf19608faf447d4b78f77ff36a770462b19a22 the function
`aspellWithDicts` was introduced, that allows to build a derivation
consisting of aspell and specified dictionaries. In
96457d26dded05bcba8e9fbb9bf0255596654aab a fix was included to properly
find the dictionaries.
Issue #29429 describes that, while the current method works for the
aspell binary, it does not in case of the API.
This commit rewrites the wrapper into a single derivation, create a
single tree of symbolic references to both the binary and the
dictionaries so that its possible to find the dictionaries with the API.
Furthermore, the binary is wrapped so it can still find the dictionaries
as well.
Currently, `aspell` checks the active profiles for dictionaries. While
this may be convenient, it does not work with `nix-shell` and it doesn't
allow any isolation.
This commit adds the possibility to use composition by creating a
derivation with `symlinkJoin` that contains all the chosen dictionaries,
and another derivation that wraps the executables linking to the dictionaries.
Nix example:
my_aspell = aspellWithDicts(ps: with ps; [ en nl ])
`nix-shell` example:
nix-shell -p 'aspellWithDicts(ps: with ps; [ en nl ])'