Hunspell not working with Emacs when using NixOS

So, I’m on NixOS, and I have just set my locale to en_GB.UTF-8. I also have Hunspell installed by adding (hunspellWithDicts ([ hunspellDicts.en_GB-ise ])) to my system.environmentPackages.

Hunspell -D outputs this:

AVAILABLE DICTIONARIES (path is not mandatory for -d option):
/nix/store/p4x47drfqwhd1j36z9bi555wp05h8m05-hunspell-dict-en-gb-ise-wordlist-2018.04.16/share/hunspell/en_GB
LOADED DICTIONARY:
/nix/store/p4x47drfqwhd1j36z9bi555wp05h8m05-hunspell-dict-en-gb-ise-wordlist-2018.04.16/share/hunspell/en_GB.aff
/nix/store/p4x47drfqwhd1j36z9bi555wp05h8m05-hunspell-dict-en-gb-ise-wordlist-2018.04.16/share/hunspell/en_GB.dic

Running M-x ispell-buffer in emacs gives me the following message: ispell-find-hunspell-dictionaries: Can’t find Hunspell dictionary with a .aff affix file This is weird, because running M-h v to and asking for the value of ispell-hunspell-dict-path-alist gives:

(("british" "/nix/store/p4x47drfqwhd1j36z9bi555wp05h8m05-hunspell-dict-en-gb-ise-wordlist-2018.04.16/share/hunspell/en_GB.aff")
 ("en_GB" "/nix/store/p4x47drfqwhd1j36z9bi555wp05h8m05-hunspell-dict-en-gb-ise-wordlist-2018.04.16/share/hunspell/en_GB.aff"))

While NixOS store paths are unusual, and while you might yet get some help here (better than my non-help), you might have more chances of being helped in an emacs related forum.

I have setup Hunspell with home-manager and it worked just fine at least on NixOS.
In an Ubuntu WSL I’m having some trouble but I didn’t fix that yet because I mainly just write code in that environment.

The following two links are all I have configured, maybe it helps:

I’ve marked this as solved! Thanks for your help here!

1 Like