nix-community.nixvim/plugins/languages/haskell-scope-highlighting.nix
Gustavo Araiza 3958364809 plugins/haskell-scope-highlighting: init + test
Add warning for Treesitter dependency

Co-authored-by: Gaétan Lepage <33058747+GaetanLepage@users.noreply.github.com>

add test for highlights, add package

tweak warning message

enable treesitter in tests

suggested change
2024-01-29 08:47:37 +01:00

24 lines
677 B
Nix

{
lib,
pkgs,
helpers,
config,
...
}:
with lib; let
cfg = config.plugins.haskell-scope-highlighting;
in {
options.plugins.haskell-scope-highlighting = {
enable = mkEnableOption "haskell-scope-highlighting";
package = helpers.mkPackageOption "haskell-scope-highlighting" pkgs.vimPlugins.haskell-scope-highlighting-nvim;
};
config = mkIf cfg.enable {
warnings = optional (!config.plugins.treesitter.enable) ''
Nixvim (plugins.haskell-scope-highlighting): haskell-scope-highlighting needs treesitter to function as intended. Please, enable it by setting `plugins.treesitter.enable` to `true`.
'';
extraPlugins = [cfg.package];
};
}