nix/nvim/default.nix

147 lines
3.7 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;
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
# ------------------
# ----- Helpers ----
# ------------------
aerial-nvim # Code Outline
comment-nvim # Code Comments
diffview-nvim # Diff View
leap-nvim # Quick Movement
neo-tree-nvim # File Explorer
null-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
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
2023-09-08 12:41:16 +00:00
nvim-notify # Noice Dependency
2022-12-04 19:32:16 +00:00
nord-nvim # Theme
2022-11-25 16:30:22 +00:00
nvim-web-devicons # Dev Icons
# ------------------
# --- Treesitter ---
# ------------------
2023-09-08 12:41:16 +00:00
nvim-treesitter.withAllGrammars
2022-11-25 16:30:22 +00:00
2022-12-04 19:32:16 +00:00
# ------------------
# ----- Silicon ----
# ------------------
(
pkgs.vimUtils.buildVimPluginFrom2Nix {
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
}
)
2022-12-06 23:27:25 +00:00
# ------------------
# ------ Duck ------
# ------------------
# (
# pkgs.vimUtils.buildVimPluginFrom2Nix {
# pname = "duck.nvim";
# version = "2022-12-06";
# src = pkgs.fetchFromGitHub {
# owner = "tamton-aquib";
# repo = "duck.nvim";
# rev = "b1a3b4e52eec886bf4ce5ed692a2162d504d9632";
# sha256 = "0clc9s175mjzrkcjmwhl60fycdxgn24wkhcggaw1gsfspnlizr8z";
# };
# meta.homepage = "https://github.com/tamton-aquib/duck.nvim/";
# }
# )
2022-11-25 16:30:22 +00:00
];
extraPackages = with pkgs; [
# Telescope Dependencies
ripgrep
fd
2023-09-08 12:41:16 +00:00
tree-sitter
2022-11-25 16:30:22 +00:00
# LSP Dependencies
nodePackages.pyright
nodePackages.typescript
nodePackages.typescript-language-server
nodePackages.vscode-langservers-extracted
2023-08-31 13:03:45 +00:00
gopls
2023-09-08 12:41:16 +00:00
go
2022-11-25 16:30:22 +00:00
# Formatters
luaformatter
nixpkgs-fmt
nodePackages.prettier
sqlfluff
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 = {
tsserver = "${pkgs.nodePackages.typescript-language-server}/bin/typescript-language-server",
tslib = "${pkgs.nodePackages.typescript}/lib/node_modules/typescript/lib/",
vscodels = "${pkgs.nodePackages.vscode-langservers-extracted}",
2023-08-31 13:03:45 +00:00
gopls = "${pkgs.gopls}",
2022-11-25 16:30:22 +00:00
}
return nix_vars
'';
};
}