neovimUtils.grammarToPlugin: improve error message on invalid grammarPlugins

Update pkgs/applications/editors/neovim/utils.nix

Co-authored-by: Perchun Pak <github@perchun.it>

Update pkgs/applications/editors/neovim/utils.nix

Co-authored-by: Austin Horstman <khaneliman12@gmail.com>

Update pkgs/applications/editors/neovim/utils.nix

OH

Co-authored-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
birdee 2024-11-18 11:29:28 -08:00
parent 2b552e98ea
commit 600f8504be

View File

@ -176,7 +176,11 @@ let
(lib.replaceStrings [ "-" ] [ "_" ])
];
nvimGrammars = lib.mapAttrsToList (name: value: value.origGrammar) vimPlugins.nvim-treesitter.grammarPlugins;
nvimGrammars = lib.mapAttrsToList (
name: value:
value.origGrammar
or (builtins.throw "additions to `pkgs.vimPlugins.nvim-treesitter.grammarPlugins` set should be passed through `pkgs.neovimUtils.grammarToPlugin` first")
) vimPlugins.nvim-treesitter.grammarPlugins;
isNvimGrammar = x: builtins.elem x nvimGrammars;
toNvimTreesitterGrammar = callPackage ({ }: