Fix aspell on Linux (and probably Mac, too)

This commit is contained in:
2024-10-03 14:23:29 -07:00
parent 64a5859746
commit 8fdb6dca82

View File

@@ -3,6 +3,7 @@ with config.lib.file;
let dotdir = "${config.home.homeDirectory}/.dotfiles"; let dotdir = "${config.home.homeDirectory}/.dotfiles";
isOnMac = pkgs.stdenv.hostPlatform.isDarwin; isOnMac = pkgs.stdenv.hostPlatform.isDarwin;
emacsWithPackages = (pkgs.emacsPackagesFor pkgs.emacs29).emacsWithPackages; emacsWithPackages = (pkgs.emacsPackagesFor pkgs.emacs29).emacsWithPackages;
aspell = (pkgs.aspellWithDicts (d: [d.en]));
in in
{ {
home.packages = with pkgs; let home.packages = with pkgs; let
@@ -12,7 +13,7 @@ in
])) ]))
zstd zstd
emacs-lsp-booster emacs-lsp-booster
(aspellWithDicts (d: [d.en])) aspell
]; ];
macPackages = basePackages ++ [ coreutils ]; macPackages = basePackages ++ [ coreutils ];
in in
@@ -21,4 +22,12 @@ in
xdg.configFile = { xdg.configFile = {
"emacs".source = mkOutOfStoreSymlink "${dotdir}/thoom-emacs"; "emacs".source = mkOutOfStoreSymlink "${dotdir}/thoom-emacs";
}; };
# The aspell wrapper created by aspellWithDicts only wraps the
# binary, not the library, so we need to write a config file that
# tells it where to find things for libenchant to work. See:
# https://discourse.nixos.org/t/aspell-dictionaries-are-not-available-to-enchant/39254
home.file.".aspell.conf".text = ''
dict-dir ${aspell}/lib/aspell
'';
} }