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 ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -35,8 +35,7 @@
|
|||||||
:general (:states '(normal visual)
|
:general (:states '(normal visual)
|
||||||
"z =" #'syd-jinx-or-ispell)
|
"z =" #'syd-jinx-or-ispell)
|
||||||
:config
|
:config
|
||||||
;; Default is "en_US"; fuck that!
|
(jinx-languages "en_GB en_US ko_KR" t))
|
||||||
(jinx-languages "en" t))
|
|
||||||
|
|
||||||
(defvar syd-prose-mode-hook
|
(defvar syd-prose-mode-hook
|
||||||
(list #'syd-prose-set-visual-fill-column-center
|
(list #'syd-prose-set-visual-fill-column-center
|
||||||
|
|||||||
@@ -6,28 +6,16 @@ in {
|
|||||||
enable = lib.mkEnableOption "Jinx spell-check";
|
enable = lib.mkEnableOption "Jinx spell-check";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable
|
config = lib.mkIf cfg.enable {
|
||||||
(let
|
sydnix.impermanence.directories =
|
||||||
my-aspell = pkgs.aspellWithDicts
|
let xdg-config-home =
|
||||||
(dicts: with dicts; [
|
lib.removePrefix "${config.home.homeDirectory}/"
|
||||||
en en-computers en-science
|
(lib.removePrefix "~/"
|
||||||
]);
|
config.xdg.configHome);
|
||||||
in {
|
in [ "${xdg-config-home}/enchant" ];
|
||||||
sydnix.impermanence.directories =
|
|
||||||
let xdg-config-home =
|
|
||||||
lib.removePrefix "${config.home.homeDirectory}/"
|
|
||||||
(lib.removePrefix "~/"
|
|
||||||
config.xdg.configHome);
|
|
||||||
in [ "${xdg-config-home}/enchant" ];
|
|
||||||
|
|
||||||
sydnix.emacs = {
|
sydnix.emacs.emacsPackages = epkgs: [
|
||||||
emacsPackages = epkgs: [
|
epkgs.jinx
|
||||||
epkgs.jinx
|
];
|
||||||
];
|
};
|
||||||
extraWrapProgramArgs = [
|
|
||||||
"--prefix" "PATH" ":" (lib.makeBinPath [my-aspell])
|
|
||||||
"--set" "ASPELL_CONF" "dict-dir ${my-aspell}/lib/aspell"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|||||||
19
modules/home/users/msyds/hunspell.nix
Normal file
19
modules/home/users/msyds/hunspell.nix
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.sydnix.users.msyds.hunspell;
|
||||||
|
in {
|
||||||
|
options.sydnix.users.msyds.hunspell = {
|
||||||
|
enable = lib.mkEnableOption "Hunspell";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
sydnix.hunspell = {
|
||||||
|
enable = true;
|
||||||
|
dictionaries = ds: with ds; [
|
||||||
|
en_US
|
||||||
|
en_GB-ise # en_GB with -ise endings.
|
||||||
|
ko_KR
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -35,6 +35,7 @@
|
|||||||
waybar.enable = true;
|
waybar.enable = true;
|
||||||
};
|
};
|
||||||
users.msyds = {
|
users.msyds = {
|
||||||
|
hunspell.enable = true;
|
||||||
emacs.enable = true;
|
emacs.enable = true;
|
||||||
impermanence.enable = true;
|
impermanence.enable = true;
|
||||||
syncthing.enable = true;
|
syncthing.enable = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user