2024-10-27 12:23:20 +01:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
cfg = config.pim.neovim;
|
|
|
|
in {
|
|
|
|
options.pim.neovim.enable = lib.mkEnableOption "neovim";
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2023-10-08 16:57:57 +02:00
|
|
|
programs.neovim = {
|
|
|
|
enable = true;
|
|
|
|
viAlias = true;
|
|
|
|
vimAlias = true;
|
|
|
|
vimdiffAlias = true;
|
|
|
|
defaultEditor = true;
|
2023-10-30 21:37:23 +01:00
|
|
|
extraLuaConfig = builtins.readFile ./core.lua;
|
2023-10-13 11:13:15 +02:00
|
|
|
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
nil
|
|
|
|
nodePackages.pyright
|
|
|
|
gopls
|
|
|
|
terraform-ls
|
2024-06-04 21:21:38 +02:00
|
|
|
nixfmt-classic
|
2023-11-30 16:59:49 +01:00
|
|
|
stylua
|
|
|
|
black
|
2023-12-16 16:12:13 +01:00
|
|
|
nixpkgs-fmt
|
2023-10-13 11:13:15 +02:00
|
|
|
];
|
|
|
|
|
2023-10-08 16:57:57 +02:00
|
|
|
plugins = with pkgs.vimPlugins; [
|
2023-10-30 21:37:23 +01:00
|
|
|
{
|
|
|
|
plugin = nvim-lspconfig;
|
|
|
|
type = "lua";
|
|
|
|
config = builtins.readFile ./lspconfig.lua;
|
|
|
|
}
|
2023-10-08 16:57:57 +02:00
|
|
|
gruvbox-nvim
|
2023-10-30 21:37:23 +01:00
|
|
|
{
|
|
|
|
plugin = leap-nvim;
|
|
|
|
type = "lua";
|
|
|
|
config = builtins.readFile ./leap.lua;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = telescope-nvim;
|
|
|
|
type = "lua";
|
|
|
|
config = builtins.readFile ./telescope.lua;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = vim-commentary;
|
|
|
|
type = "lua";
|
2023-11-07 13:54:14 +01:00
|
|
|
config = builtins.readFile ./commentary.lua;
|
2023-10-30 21:37:23 +01:00
|
|
|
}
|
2023-10-08 16:57:57 +02:00
|
|
|
vim-sleuth
|
2023-10-30 21:37:23 +01:00
|
|
|
{
|
|
|
|
plugin = gitsigns-nvim;
|
|
|
|
type = "lua";
|
2023-11-10 11:33:41 +01:00
|
|
|
config = ''require("gitsigns").setup()'';
|
2023-10-30 21:37:23 +01:00
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = nvim-cmp;
|
|
|
|
type = "lua";
|
|
|
|
config = builtins.readFile ./cmp.lua;
|
|
|
|
}
|
2023-10-08 16:57:57 +02:00
|
|
|
cmp-nvim-lsp
|
|
|
|
friendly-snippets
|
|
|
|
neodev-nvim
|
2023-10-13 12:26:56 +02:00
|
|
|
luasnip
|
|
|
|
cmp_luasnip
|
2023-10-30 21:37:23 +01:00
|
|
|
{
|
|
|
|
plugin = nvim-treesitter.withAllGrammars;
|
|
|
|
type = "lua";
|
|
|
|
config = builtins.readFile ./treesitter.lua;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = bufferline-nvim;
|
|
|
|
type = "lua";
|
|
|
|
config = builtins.readFile ./bufferline.lua;
|
|
|
|
}
|
2023-10-23 19:52:38 +02:00
|
|
|
nvim-web-devicons
|
2023-11-10 11:20:35 +01:00
|
|
|
lsp-format-nvim
|
2023-11-30 16:59:49 +01:00
|
|
|
{
|
2024-03-04 21:20:48 +01:00
|
|
|
plugin = pkgs.vimPlugins.none-ls-nvim;
|
2023-11-30 16:59:49 +01:00
|
|
|
type = "lua";
|
|
|
|
config = builtins.readFile ./none-ls.lua;
|
|
|
|
}
|
2023-10-08 16:57:57 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.git.extraConfig.core.editor = "nvim";
|
|
|
|
};
|
|
|
|
}
|