summaryrefslogtreecommitdiffstats
path: root/modules/plugins/lsp/null-ls/config.nix
blob: eb06870f2fee10cd7d6dfbae3eb0c471539fd76e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{
  config,
  lib,
  ...
}: let
  inherit (lib.modules) mkIf mkMerge;
  inherit (lib.nvim.lua) toLuaObject;
  inherit (lib.nvim.dag) entryAfter;

  cfg = config.vim.lsp.null-ls;
in {
  config = mkIf cfg.enable (mkMerge [
    {
      vim = {
        startPlugins = [
          "none-ls-nvim"
          "plenary-nvim"
        ];

        # null-ls implies that LSP is already being set up
        # as it will hook into LSPs to receive information.
        lsp.enable = true;

        pluginRC.null_ls = entryAfter ["lsp-setup"] ''
          require('null-ls').setup(${toLuaObject cfg.setupOpts})
        '';
      };
    }
  ]);
}