2023-12-28 18:15:39 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
# vars,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
vars = import ../../../../vars.nix;
|
|
|
|
colors = config.colorScheme.colors;
|
|
|
|
in {
|
2023-12-28 18:22:05 +01:00
|
|
|
home.sessionVariables.EDITOR = "nvim";
|
|
|
|
|
2023-12-28 18:15:39 +01:00
|
|
|
programs.neovim = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
viAlias = true;
|
|
|
|
vimAlias = true;
|
|
|
|
vimdiffAlias = true;
|
|
|
|
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
# LSP
|
|
|
|
lua-language-server
|
|
|
|
lua
|
|
|
|
rnix-lsp # nix
|
|
|
|
|
|
|
|
# Formatters
|
|
|
|
stylua # lua
|
|
|
|
black # pyton
|
|
|
|
alejandra # nix
|
|
|
|
clang-tools_16 # c/c++
|
|
|
|
|
|
|
|
# Linters
|
|
|
|
ruff # python
|
|
|
|
nodePackages.jsonlint # json
|
|
|
|
nodePackages.eslint_d # javascript
|
|
|
|
|
|
|
|
# Tools
|
|
|
|
xclip
|
|
|
|
wl-clipboard
|
|
|
|
fzf
|
|
|
|
gcc
|
|
|
|
];
|
|
|
|
|
|
|
|
plugins = with pkgs.vimPlugins; [
|
|
|
|
{
|
|
|
|
plugin = neodev-nvim;
|
|
|
|
type = "lua";
|
|
|
|
config = ''
|
|
|
|
require("neodev").setup({
|
|
|
|
override = function(root_dir, library)
|
|
|
|
if root_dir:find("/home/${vars.user + "/" + vars.dir_name}", 1, true) == 1 then
|
|
|
|
library.enabled = true
|
|
|
|
library.plugins = true
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
plugin = nvim-lspconfig;
|
|
|
|
config = builtins.readFile ./plugin/lsp.lua;
|
|
|
|
type = "lua";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
plugin = comment-nvim;
|
|
|
|
config = "require('Comment').setup()";
|
|
|
|
type = "lua";
|
|
|
|
}
|
|
|
|
|
2024-01-07 15:32:21 +01:00
|
|
|
cmp-path
|
2023-12-28 18:15:39 +01:00
|
|
|
nvim-cmp
|
|
|
|
{
|
|
|
|
plugin = nvim-cmp;
|
|
|
|
config = builtins.readFile ./plugin/cmp.lua;
|
|
|
|
type = "lua";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
plugin = telescope-nvim;
|
|
|
|
config = builtins.readFile ./plugin/telescope.lua;
|
|
|
|
type = "lua";
|
|
|
|
}
|
|
|
|
|
|
|
|
telescope-fzf-native-nvim
|
|
|
|
telescope-ui-select-nvim
|
|
|
|
|
|
|
|
cmp_luasnip
|
|
|
|
cmp-nvim-lsp
|
|
|
|
|
|
|
|
luasnip
|
|
|
|
friendly-snippets
|
|
|
|
|
|
|
|
{
|
2023-12-30 12:56:02 +01:00
|
|
|
plugin = nvim-treesitter.withPlugins (p: [
|
|
|
|
p.vim
|
|
|
|
p.bash
|
|
|
|
p.lua
|
|
|
|
p.python
|
|
|
|
p.json
|
|
|
|
p.java
|
|
|
|
p.rust
|
|
|
|
p.cpp
|
2024-01-07 15:33:41 +01:00
|
|
|
p.c
|
2023-12-30 12:56:02 +01:00
|
|
|
p.css
|
|
|
|
p.csv
|
|
|
|
p.dockerfile
|
|
|
|
p.diff
|
|
|
|
p.gitignore
|
|
|
|
p.git_config
|
|
|
|
p.gitattributes
|
|
|
|
p.make
|
|
|
|
p.yaml
|
|
|
|
p.toml
|
|
|
|
p.typescript
|
|
|
|
p.xml
|
|
|
|
]);
|
2023-12-28 18:15:39 +01:00
|
|
|
config = builtins.readFile ./plugin/treesitter.lua;
|
|
|
|
type = "lua";
|
|
|
|
}
|
|
|
|
|
|
|
|
vim-nix
|
|
|
|
|
|
|
|
{
|
|
|
|
plugin = nvim-base16;
|
|
|
|
config = ''
|
|
|
|
require('base16-colorscheme').setup({
|
|
|
|
base00 = '#${colors.base00}', base01 = '#${colors.base01}', base02 = '#${colors.base02}', base03 = '#${colors.base03}',
|
|
|
|
base04 = '#${colors.base04}', base05 = '#${colors.base05}', base06 = '#${colors.base06}', base07 = '#${colors.base07}',
|
|
|
|
base08 = '#${colors.base08}', base09 = '#${colors.base09}', base0A = '#${colors.base0A}', base0B = '#${colors.base0B}',
|
|
|
|
base0C = '#${colors.base0C}', base0D = '#${colors.base0D}', base0E = '#${colors.base0E}', base0F = '#${colors.base0F}',
|
|
|
|
})'';
|
|
|
|
type = "lua";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
plugin = lualine-nvim;
|
|
|
|
config = builtins.readFile ./plugin/lualine.lua;
|
|
|
|
type = "lua";
|
|
|
|
}
|
|
|
|
|
|
|
|
nvim-web-devicons
|
|
|
|
plenary-nvim
|
|
|
|
nui-nvim
|
|
|
|
{
|
|
|
|
plugin = neo-tree-nvim;
|
2024-01-07 15:32:57 +01:00
|
|
|
config = builtins.readFile ./plugin/neo-tree.lua;
|
2023-12-28 18:15:39 +01:00
|
|
|
type = "lua";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
plugin = gitsigns-nvim;
|
|
|
|
config = "require('gitsigns').setup()";
|
|
|
|
type = "lua";
|
|
|
|
}
|
|
|
|
|
|
|
|
diffview-nvim
|
|
|
|
lazygit-nvim
|
|
|
|
|
|
|
|
{
|
|
|
|
plugin = todo-comments-nvim;
|
|
|
|
config = builtins.readFile ./plugin/todo.lua;
|
|
|
|
type = "lua";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
plugin = alpha-nvim;
|
|
|
|
config = builtins.readFile ./plugin/alpha.lua;
|
|
|
|
type = "lua";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
plugin = none-ls-nvim;
|
|
|
|
config = builtins.readFile ./plugin/none-ls.lua;
|
|
|
|
type = "lua";
|
|
|
|
}
|
2024-01-07 15:33:29 +01:00
|
|
|
|
2024-01-07 15:33:57 +01:00
|
|
|
{
|
|
|
|
plugin = nvim-autopairs;
|
|
|
|
config = "require('nvim-autopairs').setup({})";
|
|
|
|
type = "lua";
|
|
|
|
}
|
|
|
|
|
2024-01-07 15:33:29 +01:00
|
|
|
{
|
|
|
|
plugin = barbar-nvim;
|
|
|
|
config = builtins.readFile ./plugin/barbar.lua;
|
|
|
|
}
|
|
|
|
|
2023-12-28 18:15:39 +01:00
|
|
|
];
|
2023-12-29 14:19:04 +01:00
|
|
|
|
|
|
|
extraLuaConfig = ''
|
|
|
|
${builtins.readFile ./options.lua}
|
|
|
|
'';
|
2023-12-28 18:15:39 +01:00
|
|
|
};
|
2023-12-28 18:22:05 +01:00
|
|
|
|
|
|
|
xdg.desktopEntries = {
|
|
|
|
nvim = {
|
|
|
|
name = "Neovim";
|
|
|
|
genericName = "Text Editor";
|
|
|
|
comment = "Edit text files";
|
|
|
|
exec = "nvim %F";
|
|
|
|
icon = "nvim";
|
|
|
|
mimeType = [
|
|
|
|
"text/english"
|
|
|
|
"text/plain"
|
|
|
|
"text/x-makefile"
|
|
|
|
"text/x-c++hdr"
|
|
|
|
"text/x-c++src"
|
|
|
|
"text/x-chdr"
|
|
|
|
"text/x-csrc"
|
|
|
|
"text/x-java"
|
|
|
|
"text/x-moc"
|
|
|
|
"text/x-pascal"
|
|
|
|
"text/x-tcl"
|
|
|
|
"text/x-tex"
|
|
|
|
"application/x-shellscript"
|
|
|
|
"text/x-c"
|
|
|
|
"text/x-c++"
|
|
|
|
];
|
|
|
|
terminal = true;
|
|
|
|
type = "Application";
|
|
|
|
categories = ["Utility" "TextEditor"];
|
|
|
|
};
|
|
|
|
};
|
2023-12-28 18:15:39 +01:00
|
|
|
}
|