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

96 lines
1.8 KiB
Nix
Raw Normal View History

2023-08-30 07:30:35 +09:00
{qconfig, pkgs, ... }: {
2023-07-01 21:25:37 +09:00
programs.neovim = {
2023-08-29 20:09:37 +09:00
package = pkgs.neovim-unwrapped;
2023-07-01 19:02:59 +09:00
enable = true;
2023-07-01 21:25:07 +09:00
defaultEditor = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
2023-08-29 18:54:57 +09:00
plugins = with pkgs.vimPlugins; [
nvchad
2023-08-30 07:30:35 +09:00
fugitive
2023-07-01 20:08:44 +09:00
];
2023-08-29 19:46:03 +09:00
};
2023-08-29 20:21:25 +09:00
2023-08-29 21:15:01 +09:00
# nvchad requires gcc, npm, and unzip
2023-08-29 21:17:12 +09:00
home.packages = [
pkgs.gcc
pkgs.unzip
2023-08-29 21:48:52 +09:00
pkgs.nodejs_20
2023-08-30 07:30:35 +09:00
pkgs.ripgrep
2023-08-29 21:15:01 +09:00
];
2023-08-29 20:21:25 +09:00
# Link the nvchad files to my homedir
# https://mipmip.github.io/home-manager-option-search/?query=xdg.dataFile
2023-08-29 20:49:54 +09:00
xdg.configFile."nvim" = {
2023-08-29 20:21:25 +09:00
enable = true;
2023-08-29 20:22:01 +09:00
recursive = true;
2023-08-29 20:55:33 +09:00
source = "${pkgs.vimPlugins.nvchad}/";
target = "./nvim";
2023-08-29 20:21:25 +09:00
};
2023-08-30 14:02:30 +09: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 19:10:20 +09:00
}