nixos-configs/home-manager/neovim/default.nix

96 lines
2.1 KiB
Nix
Raw Permalink Normal View History

2024-10-27 11:23:20 +00:00
{
pkgs,
config,
lib,
...
}: let
cfg = config.pim.neovim;
in {
options.pim.neovim.enable = lib.mkEnableOption "neovim";
config = lib.mkIf cfg.enable {
2024-12-17 19:43:10 +00:00
# Disable Stylix styling of Neovim,
# because we have a plugin for that.
stylix.targets.neovim.enable = false;
2023-10-08 14:57:57 +00:00
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
defaultEditor = true;
extraLuaConfig = builtins.readFile ./core.lua;
extraPackages = with pkgs; [
nil
2024-11-30 12:14:46 +00:00
pyright
gopls
terraform-ls
2024-06-04 19:21:38 +00:00
nixfmt-classic
stylua
black
nixpkgs-fmt
];
2023-10-08 14:57:57 +00:00
plugins = with pkgs.vimPlugins; [
{
plugin = nvim-lspconfig;
type = "lua";
config = builtins.readFile ./lspconfig.lua;
}
2023-10-08 14:57:57 +00:00
gruvbox-nvim
{
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 12:54:14 +00:00
config = builtins.readFile ./commentary.lua;
}
2023-10-08 14:57:57 +00:00
vim-sleuth
{
plugin = gitsigns-nvim;
type = "lua";
config = ''require("gitsigns").setup()'';
}
{
plugin = nvim-cmp;
type = "lua";
config = builtins.readFile ./cmp.lua;
}
2023-10-08 14:57:57 +00:00
cmp-nvim-lsp
friendly-snippets
neodev-nvim
2023-10-13 10:26:56 +00:00
luasnip
cmp_luasnip
{
plugin = nvim-treesitter.withAllGrammars;
type = "lua";
config = builtins.readFile ./treesitter.lua;
}
{
plugin = bufferline-nvim;
type = "lua";
config = builtins.readFile ./bufferline.lua;
}
2023-10-23 17:52:38 +00:00
nvim-web-devicons
lsp-format-nvim
{
plugin = pkgs.vimPlugins.none-ls-nvim;
type = "lua";
config = builtins.readFile ./none-ls.lua;
}
2023-10-08 14:57:57 +00:00
];
};
programs.git.extraConfig.core.editor = "nvim";
};
}