aboutsummaryrefslogtreecommitdiff
path: root/modules/neovim/default.nix
blob: 80525358061bb2fc1830498d2af5d039f8405212 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{ config, lib, pkgs, ...}:
let
  cfg = config.modules.neovim;
in
{
  options.modules.neovim = {
    enable = lib.mkEnableOption "neovim";
  };

  config = lib.mkIf cfg.enable {
    xdg.configFile."nvim/lua" = {
      source = ./nvim/lua;
      recursive = true;
    };

    xdg.configFile."nvim/after" = {
      source = ./nvim/after;
      recursive = true;
    };

    programs.neovim = {
      enable = true;
      defaultEditor = true;
      viAlias = true;
      vimAlias = true;
      vimdiffAlias = true;
      plugins = with pkgs.vimPlugins; [
        (nvim-treesitter.withPlugins (p: with p; [
          tree-sitter-nix
          tree-sitter-c
          tree-sitter-cpp
          tree-sitter-lua
          tree-sitter-zig
          tree-sitter-rust
          tree-sitter-toml
          tree-sitter-markdown
          tree-sitter-markdown-inline
        ]))

        {
          plugin = lean-nvim;
          config = ''
            require('lean').setup{ mappings = true }
          '';
          type = "lua";
        }
        plenary-nvim
#       blink-cmp
        nvim-lspconfig
        base16-nvim
        telescope-nvim
        telescope-fzf-native-nvim
        vim-obsession
      ];
      extraLuaConfig = ''
        ${builtins.readFile ./nvim/init.lua}
      '';
    };
  };
}