nix/home-manager/common/software/cli/neovim.nix

96 lines
1.8 KiB
Nix
Raw Normal View History

2023-09-15 05:03:35 +02:00
{config, pkgs, ... }: {
2023-07-01 14:25:37 +02:00
programs.neovim = {
2023-08-29 13:09:37 +02:00
package = pkgs.neovim-unwrapped;
2023-07-01 12:02:59 +02:00
enable = true;
2023-07-01 14:25:07 +02:00
defaultEditor = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
2023-08-29 11:54:57 +02:00
plugins = with pkgs.vimPlugins; [
nvchad
2023-08-30 00:30:35 +02:00
fugitive
2023-07-01 13:08:44 +02:00
];
2023-08-29 12:46:03 +02:00
};
2023-08-29 13:21:25 +02:00
2023-08-29 14:15:01 +02:00
# nvchad requires gcc, npm, and unzip
2023-08-29 14:17:12 +02:00
home.packages = [
pkgs.gcc
pkgs.unzip
2023-08-29 14:48:52 +02:00
pkgs.nodejs_20
2023-08-30 00:30:35 +02:00
pkgs.ripgrep
2023-08-29 14:15:01 +02:00
];
2023-08-29 13:21:25 +02:00
# Link the nvchad files to my homedir
# https://mipmip.github.io/home-manager-option-search/?query=xdg.dataFile
2023-08-29 13:49:54 +02:00
xdg.configFile."nvim" = {
2023-08-29 13:21:25 +02:00
enable = true;
2023-08-29 13:22:01 +02:00
recursive = true;
2023-08-29 13:55:33 +02:00
source = "${pkgs.vimPlugins.nvchad}/";
target = "./nvim";
2023-08-29 13:21:25 +02:00
};
2023-08-30 07:02:30 +02:00
xdg.configFile."nvim-custom-plugins" = {
enable = true;
target = "./nvim/lua/custom/plugins.lua";
text = ''
local overrides = require("custom.configs.overrides")
---@type NvPluginSpec[]
local plugins = {
-- Override plugin definition options
{
"neovim/nvim-lspconfig",
dependencies = {
-- format & linting
{
"jose-elias-alvarez/null-ls.nvim",
config = function()
require "custom.configs.null-ls"
end,
},
},
config = function()
require "plugins.configs.lspconfig"
require "custom.configs.lspconfig"
end, -- Override to setup mason-lspconfig
},
-- override plugin configs
{
"williamboman/mason.nvim",
opts = overrides.mason
},
{
"nvim-treesitter/nvim-treesitter",
opts = overrides.treesitter,
},
{
"nvim-tree/nvim-tree.lua",
opts = overrides.nvimtree,
},
-- Install a plugin
{
"max397574/better-escape.nvim",
event = "InsertEnter",
config = function()
require("better_escape").setup()
end,
},
-- vim-fugitive for integrated Git
{
"tpope/vim-fugitive",
event = "VeryLazy",
}
}
return plugins
'';
};
2023-08-29 12:10:20 +02:00
}