reddit / emacs

flyspeck / ispell.el does not find aspell dictionary on NixOS

Tall_Leadership5749 · 2022-11-11 11:24
Hi, I'm on NixOS with packages `aspell`, `aspellDicts.en`, `aspellDicts.de` installed. When I switch to german dictionary in emacs 28.1 via `ispell-change-dictionary` and try to check a word with `M-$`, I get the following messages: >Starting new Ispell process /run/current-system/sw/bin/aspell with german dictionary...done ispell-init-process: Error: The file "/nix/store/96n79c5sfssmn24rpfy7gvsfxcw959k2-aspell-0.60.8/lib/aspell/german" can not be opened for reading. I've set `ispell-aspell-dict-dir` (and also tried setting `ispell-aspell-data-dir`) to `/run/current-system/sw/lib/aspell`, where `german.alias` and other dictionary files like `de.dat` can be found. Unfortunately this does not have any effect, ispell.el still tries to open the dictionary via the /nix/store directory of the aspell package (not aspellDicts.de package!) like in the messages above. Does anyone have any idea how to fix that?
Tall_Leadership5749 · 2022-11-11 12:52
for the records: I created the file `~/.aspell.conf` and added >`dict-dir /run/current-system/sw/lib/aspell` . Now aspell finds the dictionaries. However, what is the variable `ispell-aspell-dict-dir` then good for?
frozeninfate · 2022-11-11 15:24
`ispell-aspell-dict-dir` usually works, but on NixOS does not due to how nixos passes dictionaries to aspell. With nix, the aspell on your path is a wrapper script that calls the real aspell with flags for the nix dictionary paths.