Emacs with aspell/ispell on Nix Darwin
British English and Emacs
I like writing and was keen to introduce an on-the-fly spellchecker in Emacs. Ispell is built in to the current version I'm using (29.1). However it was locked to the default US dictionary. Easy fix right?
Discoveries
Out the box the latest version of ispell on Nix Packages and built in Emacs does not have UK/British English default. So I started looking on Reddit and Googled ispell and Nix to see where I could go.
Emacs philosophy and approach
I am a strong believer in keeping things simple and with the introduction of 'use-package' and the extra features in 29.1 I was keen to rewrite my config and use as close to vanilla setup as possible. I took the very base of what was needed and started from scratch building outward and exploring built-in packages. My config file is available here: nix-darwin repo
Emacs Aspell/Ispell config
Add this to your init.el:
;; Spellcheck (require 'ispell) (setq ispell-program-name "aspell") (dolist (hook '(text-mode-hook)) (add-hook hook (lambda () (flyspell-mode 1))))
NixOS/ Nix Darwin
With the emphasis on declarative, reproducible systems, I've been using Nix for some time now. I have a config for Linux/NixOS outside of work, when at work I use a Macbook so have a Nix Darwin build for that. The addition of aspell with dictionaries was surprisingly simple once I'd worked out how to declare it in my configuration file:
# System Packages environment.systemPackages = with pkgs; [ # Applications (aspellWithDicts (dicts: with dicts; [ en en-computers en-science ])) ispell # Other Packages ];