-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
aspellWithDicts: create derivation with aspell and selected dictionaries #26622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Composition always increases space usage. The example derivation is 4 MB. We may choose to create only symbolic links for the dictionaries and then wrappers for the executables. |
postBuild = '' | ||
# wrapProgram $out/bin/aspell --set ASPELL_CONF "data-dir $out/lib/aspell" | ||
# We cannot simply use wrapProgram because we're not allowed to modify items in $out/bin | ||
unlink $out/bin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why unlink rather than the more conventional rm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, of course, removing individual items with rm
doesn't work because the directory containing them is a symbolic link itself. I actually hadn't tried using rm
on symbolic link to /bin
.
Did you consider making the dictionaries directory a separate derivation? That would avoid modifying the result of buildEnv and the need to remove part of what it created. It would also result in the |
Yes, if I understand you correctly. My idea was to have then two derivations, one with wrappers pointing to the other consisting of symlinks to the dicts.
|
I prefer having the option of installing things in my profile. I don't think you need to remove that feature to get what you want. When ASPELL_CONF is set in the pure wrapper, the impure wrapper automatically disables profile traversal. (You can also unset NIX_PROFILES in the pure wrapper just to be sure.) |
@bjornfor good point, I had missed that. I'll update the PR. |
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 `buildEnv` that contains `aspell` and selected dictionaries. Nix example: my_aspell = aspellWithDicts(ps: with ps; [ en nl ]) `nix-shell` example: nix-shell -p 'aspellWithDicts(ps: with ps; [ en nl ])'
It may be good if the different spell checkers work similarly. |
Just a remark about hunspell. I didn't manage to make hunspell work even using Edit. Maybe i am a bit confused: probably it is not hunspell that does not work, but its dictionaries are not seen by different applications, like Evolution or gEdit. |
Applications typically need to be compiled with support and they may assume/hardcode a path where the dictionaries could be. See #26654. |
@lheckemann alternative at FRidh@3d72a3c. Note the commit message needs to be updated. |
@FRidh can you update the PR to the alternate version? I'd really like to see this in nixpkgs 👍 |
Pushed c0cf196 to master. |
Currently,
aspell
checks the active profiles for dictionaries. Whilethis may be convenient, it does not work with
nix-shell
and it doesn'tallow any isolation.
This commit adds the possibility to use composition by creating a
derivation with
buildEnv
that containsaspell
and selecteddictionaries.
Nix example:
nix-shell
example: