Closed calvertvl closed 2 years ago
What does hunspell -D
output for you? I have a similar configuration as you and have no problem:
$ hunspell -D
SEARCH PATH:
.::/home/lukas/.nix-profile/share/hunspell:/etc/profiles/per-user/lukas/share/hunspell:/nix/var/nix/profiles/default/share/hunspell:/run/current-system/sw/share/hunspell:/usr/share/hunspell:/usr/share/myspell:/usr/share/myspell/dicts:/Library/Spelling:/home/lukas/.openoffice.org/3/user/wordbook:/home/lukas/.openoffice.org2/user/wordbook:/home/lukas/.openoffice.org2.0/user/wordbook:/home/lukas/Library/Spelling:/opt/openoffice.org/basis3.0/share/dict/ooo:/usr/lib/openoffice.org/basis3.0/share/dict/ooo:/opt/openoffice.org2.4/share/dict/ooo:/usr/lib/openoffice.org2.4/share/dict/ooo:/opt/openoffice.org2.3/share/dict/ooo:/usr/lib/openoffice.org2.3/share/dict/ooo:/opt/openoffice.org2.2/share/dict/ooo:/usr/lib/openoffice.org2.2/share/dict/ooo:/opt/openoffice.org2.1/share/dict/ooo:/usr/lib/openoffice.org2.1/share/dict/ooo:/opt/openoffice.org2.0/share/dict/ooo:/usr/lib/openoffice.org2.0/share/dict/ooo
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
/run/current-system/sw/share/hunspell/de_DE
/run/current-system/sw/share/hunspell/en_GB
/run/current-system/sw/share/hunspell/en_US
$ grep hunspell /etc/nixos/configuration.nix
hunspellDicts.de-de hunspellDicts.en-gb-large hunspellDicts.en-us hunspell
$ nix-env -q | grep hunspell # no hunspell in env
$
I'm on unstable:
- system: `"x86_64-linux"`
- host os: `Linux 5.4.53, NixOS, 20.09pre237781.32b46dd897a (Nightingale)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.3.7`
- channels(root): `"nixos-20.09pre237781.32b46dd897a"`
- channels(lukas): `""`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
Not sure if there is something else wrong or it's a bug that has been fixed. If you are comfortable with it, you could try updating to unstable. I'm however not sure if it's reversible in your case (it usually is unless there is a nix update then it is possible you won't be able to go back).
@sternenseemann , on stable it was broken; the output was above though I only have the hunspellDicts.en-us-large
dictionary and hunspell
.
I usually run unstable myself (or edge, often plus my own overlay), but this is a machine I manage for someone else and intend to put on auto-update, so I'm not sure it's worth switching to unstable.
Admittedly, I was unable to check how out-of-date the 20.03 stable channel was relative to unstable; my main NixOS box has been out of commission for a while due to LTUAE...and the libreoffice spellcheck is the more important part, anyway (but seems to have other things preventing it from working).
I'll try to get my NixOS dev box up and confirm that this works on unstable by next Monday (and whether or not stable has been fixed), and perhaps attempt to identify what caused the breakage if it is still broken.
Never mind that, I quickly tested it out on 20.03 and can confirm it is broken there for me as well. Now I guess it's a matter of looking through the commits since then to find out which commit fixed it and why?
Okay, I think I have a workaround for 20.03 which is also more nix-y I guess. Use in systemPackages
:
hunspellWithDicts [ hunspellDicts.en-us hunspellDicts.en-us-large ]
Instead of installing the dictionaries globally.
I marked this as stale due to inactivity. → More info
I stumbled upon this and I was unable to use the hunspellWithDicts
. What I did in my home-manager:
xdg.configFile = {
"hunspell/en_US.aff".source = "${pkgs.hunspellDicts.en_US}/share/hunspell/en_US.aff";
"hunspell/en_US.dic".source = "${pkgs.hunspellDicts.en_US}/share/hunspell/en_US.dic";
"hunspell/pt_PT.aff".source = "${pkgs.hunspellDicts.pt_PT}/share/hunspell/pt_PT.aff";
"hunspell/pt_PT.dic".source = "${pkgs.hunspellDicts.pt_PT}/share/hunspell/pt_PT.dic";
};
home.sessionVariables = {
DICPATH = "${config.xdg.configHome}/hunspell";
};
DICPATH
is undocumented but afaik as I found, it can contain a single search path.
Edit: Not using `systemPackages as I prefer an per-user approach. Might look into adding to home-manager.
in home-manager i juse added the dictionary packages to my home.packages list, lol
in home-manager i juse added the dictionary packages to my home.packages list, lol
Interesting.. it wasn't working on my end :| Hunspell was complaining about missing dictionaries.
(I am running in MacOS so I am not sure it is related as sometimes there are small differences in home-manager)
ah! perhaps its different on macos, yeah.
Describe the bug Hunspell cannot find dictionaries that installed globally without a problem. I have added the following packages to the global package configuration, and they show as installed (e.g. the docs for the dictionaries show up in
/run/current-system/sw/share/doc/
).Output:
Expected behavior Hunspell should be able to see at least one of the two en-US dictionaries, e.g. these files should be visible:
Workaround
Note that the following command seems to work to install it in the user-profile (for either of the dictionaries), but must be run per-user, e.g. with:
It is not possible to install both in parallel for the same user:
I would normally expect the same error to occur at the system level.
Additional context I'm trying to get spellchecking to work in LibreOffice, but if the command-line
hunspell
cannot find the libraries, I don't expect LibreOffice to do so.Notify maintainers
Metadata Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Maintainer information: