The Atom editor has a spell checker. This is a core package (built-in package management) of the editor. When I start Atom, I get the following message.
The spell checker apparently uses hunspell dictionaries. For other Linux distributions, users are advised to install the correct hunspell dictionary. So, I installed hunspell and hunspellDicts.de-de via /etc/nixos/configuration.nix. I had already guessed that that wouldn’t work and I was not surprised when Atom still could not find the dictionary.
The hunspell command itself can’t find the dictionary:
> hunspell -D
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
I suppose I could download the dictionary and put it into /home/martin/.openoffice.org/3/user/wordbook, for example. I then could point the Atom spell-checker to that directory. That should probably work. But if I wanted to download software and resources manually, I would use Windows . I hope there is a more idiomatic way that leverages Nix.
Could anyone point me in the general direction of a solution? Do I need to hack on the Nix expression for the atom package?
Unfortunately, the Atom spell checker does not use DICPATH or XDG_DATA_DIRS. But that’s an issue of the spell checker. For now, I can workaround that by adding /run/current-system/sw/share/hunspell to the list of paths the spell checker searches for dictionaries.
Sorry for reviving old thread but does installing hunspell dicts populate /run/current-system/sw/share/hunspell? Installing neither hunspellWithDicts [...] nor hunspellDicts.xx-yy via environment.systemPackages results in that directory existing nixpkgs on my system. Looking at hunspell pacakge in nixpkgs git, there don’t seem to be recent changes in this area.
Weirdly, installing via nix-env -i populates ~/.nix-profile/share/hunspell.
I’m trying to add spellchecking support to the LibreOffice package but am a bit lost wrt how to pass the installed dictionaries to the program.
Edit: Contents of /run/current-system/sw are determined by option environment.pathsToLink. Some desktop environments (lumina, mate, pantheon, plasma, lxqt, gnome3) add "/share" to the list which recursively includes /share/hunspell. If you don’t use one of those desktops then /run/current-system/sw/share/hunspell is not created.
You would use pathsToLink = [ "share/hunspell" ]; or possibly pathsToLink = [ "share/myspell/dicts" ];. And you need to add hunspellDicts.xx-yy to environment.systemPackages, not hunspellWithDicts […]. The latter derivation itself does not contain any dictionaries, only a hunspell executable wrapped so it can use the dictionaries specified.