From 2fe24d883e2c1384e52456817fe2ea22e06925d5 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 16 Feb 2024 13:58:03 +0100 Subject: [PATCH] plugins/haskell-scope-highlighting: switch to mkVimPlugin --- .../languages/haskell-scope-highlighting.nix | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/plugins/languages/haskell-scope-highlighting.nix b/plugins/languages/haskell-scope-highlighting.nix index ca9ec9d1bf..9b79ff1e28 100644 --- a/plugins/languages/haskell-scope-highlighting.nix +++ b/plugins/languages/haskell-scope-highlighting.nix @@ -5,20 +5,18 @@ config, ... }: -with lib; let - cfg = config.plugins.haskell-scope-highlighting; -in { - options.plugins.haskell-scope-highlighting = { - enable = mkEnableOption "haskell-scope-highlighting"; +with lib; + helpers.vim-plugin.mkVimPlugin config { + name = "haskell-scope-highlighting"; + originalName = "haskell-scope-highlighting.nvim"; + defaultPackage = pkgs.vimPlugins.haskell-scope-highlighting-nvim; - package = helpers.mkPackageOption "haskell-scope-highlighting" pkgs.vimPlugins.haskell-scope-highlighting-nvim; - }; + maintainers = [lib.maintainers.GaetanLepage]; - 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]; - }; -} + extraConfig = _: { + 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`. + ''; + }; + }