refactor(emacs,hunspell): swap aspell for hunspell
This commit is contained in:
29
modules/home/hunspell.nix
Normal file
29
modules/home/hunspell.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let cfg = config.sydnix.hunspell;
|
||||
in {
|
||||
options.sydnix.hunspell = {
|
||||
enable = lib.mkEnableOption "Hunspell";
|
||||
package = lib.mkPackageOption pkgs "hunspell" {};
|
||||
dictionaries = lib.mkOption {
|
||||
description = ''
|
||||
Hunspell dictionary packages to install.
|
||||
'';
|
||||
default = _: [];
|
||||
type = lib.types.anything // {
|
||||
merge =
|
||||
_loc: defs: dicts: lib.concatMap (f: f dicts) (lib.getValues defs);
|
||||
check = lib.isFunction;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.sessionVariables.DICPATH =
|
||||
lib.makeSearchPath
|
||||
"share/hunspell"
|
||||
(cfg.dictionaries pkgs.hunspellDicts);
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user