modules/neovim: separate options; move package into core/build

This commit is contained in:
raf 2024-02-19 11:18:18 +03:00
commit 199a8b06c5
No known key found for this signature in database
GPG key ID: 02D1DD3FA08B6B29
9 changed files with 258 additions and 211 deletions

View file

@ -0,0 +1,23 @@
{
lib,
config,
...
}: let
inherit (builtins) concatStringsSep;
inherit (lib) optionalString optionals mkIf nvim;
cfg = config.vim;
in {
imports = [./options.nix];
config = mkIf cfg.spellChecking.enable {
vim = {
startPlugins = optionals cfg.spellChecking.enableProgrammingWordList ["vim-dirtytalk"];
configRC.spellcheck = nvim.dag.entryAfter ["basic"] ''
${optionalString cfg.spellChecking.enable ''
set spell
set spelllang=${concatStringsSep "," cfg.spellChecking.languages}${optionalString cfg.spellChecking.enableProgrammingWordList ",programming"}
''}
'';
};
};
}