nix/nvim/default.nix

181 lines
4.9 KiB
Nix
Raw Normal View History

2022-11-25 16:30:22 +00:00
{ config, pkgs, ... }:
2022-12-01 16:38:15 +00:00
let
inherit (pkgs.lib.lists) subtractLists;
unstable = import <nixpkgs-unstable> { };
2022-12-01 16:38:15 +00:00
in
2022-11-25 16:30:22 +00:00
{
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
withNodeJs = true;
withPython3 = true;
plugins = with pkgs.vimPlugins; [
# ------------------
# --- Completion ---
# ------------------
cmp-buffer # Buffer Word Completion
cmp-cmdline # Command Line Completion
cmp-nvim-lsp # Main LSP
cmp-path # Path Completion
cmp_luasnip # Snippets Completion
2022-12-01 22:00:33 +00:00
friendly-snippets # Snippets
lsp_lines-nvim # Inline Diagnostics
luasnip # Snippets
nvim-cmp # Completions
nvim-lspconfig # LSP Config
2022-11-25 16:30:22 +00:00
2024-06-11 18:59:12 +00:00
# -------------------
# ----- Helpers -----
# -------------------
aerial-nvim # Code Outline
comment-nvim # Code Comments
diffview-nvim # Diff View
2024-04-26 15:39:10 +00:00
gitsigns-nvim # Git Blame
leap-nvim # Quick Movement
2024-01-17 15:17:22 +00:00
markdown-preview-nvim # Markdown Preview
neo-tree-nvim # File Explorer
none-ls-nvim # Formatters
numb-nvim # Peek / Jump to Lines
nvim-autopairs # Automatically Close Pairs (),[],{}
2022-12-01 22:00:33 +00:00
telescope-fzf-native-nvim # Faster Telescope
telescope-nvim # Fuzzy Finder
2024-05-25 23:16:57 +00:00
telescope-ui-select-nvim # UI
2022-12-04 19:32:16 +00:00
toggleterm-nvim # Terminal Helper
vim-nix # Nix Helpers
2022-12-04 19:32:16 +00:00
which-key-nvim # Shortcut Helper
2022-11-25 16:30:22 +00:00
# ------------------
# --- Theme / UI ---
# ------------------
lualine-nvim # Bottom Line
noice-nvim # UI Tweaks
# nord-nvim # Theme
melange-nvim # Theme
2023-09-08 12:41:16 +00:00
nvim-notify # Noice Dependency
2022-11-25 16:30:22 +00:00
nvim-web-devicons # Dev Icons
# ------------------
# --- Treesitter ---
# ------------------
nvim-treesitter-context
2023-09-08 12:41:16 +00:00
nvim-treesitter.withAllGrammars
2022-11-25 16:30:22 +00:00
2024-06-11 18:59:12 +00:00
# -------------------
# ------- DAP -------
# -------------------
nvim-dap
nvim-dap-go
nvim-dap-ui
2024-06-11 18:59:12 +00:00
# --------------------
# -- NONE-LS EXTRAS --
# --------------------
(
pkgs.vimUtils.buildVimPlugin {
pname = "none-ls-extras.nvim";
version = "2024-06-11";
src = pkgs.fetchFromGitHub {
owner = "nvimtools";
repo = "none-ls-extras.nvim";
rev = "336e84b9e43c0effb735b08798ffac382920053b";
sha256 = "sha256-UtU4oWSRTKdEoMz3w8Pk95sROuo3LEwxSDAm169wxwk=";
};
meta.homepage = "https://github.com/nvimtools/none-ls-extras.nvim/";
}
)
# -------------------
# ----- Silicon -----
# -------------------
2022-12-04 19:32:16 +00:00
(
2024-01-17 15:17:22 +00:00
pkgs.vimUtils.buildVimPlugin {
2022-12-04 19:32:16 +00:00
pname = "silicon.lua";
version = "2022-12-03";
src = pkgs.fetchFromGitHub {
2023-04-25 13:36:54 +00:00
owner = "mhanberg";
2022-12-04 19:32:16 +00:00
repo = "silicon.lua";
2023-04-25 13:36:54 +00:00
rev = "5ca462bee0a39b058786bc7fbeb5d16ea49f3a23";
sha256 = "0vlp645d5mmii513v72jca931miyrhkvhwb9bfzhix1199zx7vi2";
2022-12-04 19:32:16 +00:00
};
2023-04-25 13:36:54 +00:00
meta.homepage = "https://github.com/mhanberg/silicon.lua/";
2022-12-04 19:32:16 +00:00
}
)
2024-05-25 23:16:57 +00:00
2024-06-11 18:59:12 +00:00
# -------------------
# ------- LLM -------
# -------------------
2024-05-25 23:16:57 +00:00
(
pkgs.vimUtils.buildVimPlugin {
pname = "llm.nvim";
version = "2024-05-25";
src = pkgs.fetchFromGitHub {
owner = "David-Kunz";
repo = "gen.nvim";
rev = "bd19cf584b5b82123de977b44105e855e61e5f39";
sha256 = "sha256-0AEB6im8Jz5foYzmL6KEGSAYo48g1bkFpjlCSWT6JeE=";
};
meta.homepage = "https://github.com/David-Kunz/gen.nvim/";
}
)
2022-11-25 16:30:22 +00:00
];
extraPackages = with pkgs; [
# Telescope Dependencies
fd
ripgrep
2023-09-08 12:41:16 +00:00
tree-sitter
2022-11-25 16:30:22 +00:00
# LSP Dependencies
go
2024-03-13 06:26:11 +00:00
golangci-lint
golangci-lint-langserver
gopls
2024-05-28 00:29:55 +00:00
lua-language-server
nodePackages.eslint
unstable.eslint_d
2022-11-25 16:30:22 +00:00
nodePackages.pyright
2024-02-11 16:13:00 +00:00
nodePackages.svelte-language-server
2022-11-25 16:30:22 +00:00
nodePackages.typescript
nodePackages.typescript-language-server
nodePackages.vscode-langservers-extracted
2022-11-25 16:30:22 +00:00
# Formatters
luaformatter
nixpkgs-fmt
nodePackages.prettier
sqlfluff
2024-06-11 18:59:12 +00:00
stylua
2022-12-02 21:18:32 +00:00
2022-12-04 19:32:16 +00:00
# Silicon
silicon
2022-11-25 16:30:22 +00:00
];
extraConfig = ":luafile ~/.config/nvim/lua/init.lua";
};
xdg.configFile = {
# Copy Configuration
nvim = {
source = ./config;
recursive = true;
};
# Generate Nix Vars
"nvim/lua/nix-vars.lua".text = ''
local nix_vars = {
2024-02-11 16:13:00 +00:00
gopls = "${pkgs.gopls}/bin/gopls",
2024-05-28 00:29:55 +00:00
luals = "${pkgs.lua-language-server}/bin/lua-language-server",
2024-02-11 16:13:00 +00:00
sveltels = "${pkgs.nodePackages.svelte-language-server}/bin/svelteserver",
tsls = "${pkgs.nodePackages.typescript-language-server}/bin/typescript-language-server",
2024-03-13 06:26:11 +00:00
golintls = "${pkgs.golangci-lint-langserver}/bin/golangci-lint-langserver",
2024-03-05 22:52:30 +00:00
vscls = "${pkgs.nodePackages.vscode-langservers-extracted}",
2022-11-25 16:30:22 +00:00
}
return nix_vars
'';
};
}