aboutsummaryrefslogtreecommitdiffstats
path: root/home/nvim/default.nix
diff options
context:
space:
mode:
authorPetri Hienonen <petri.hienonen@gmail.com>2024-05-23 13:56:00 +0300
committerPetri Hienonen <petri.hienonen@gmail.com>2025-11-30 12:29:57 +0200
commit08297376a85a1719518507e54fca9de954d2376a (patch)
tree3b9c58304b40248533bbb2bb5b7bad2da9da1ff0 /home/nvim/default.nix
parent75c2af4aedd2ac5c2cfc74b346625fa4b265541d (diff)
downloadnixos-08297376a85a1719518507e54fca9de954d2376a.tar.zst
Agenix configuration
Diffstat (limited to 'home/nvim/default.nix')
-rw-r--r--home/nvim/default.nix93
1 files changed, 93 insertions, 0 deletions
diff --git a/home/nvim/default.nix b/home/nvim/default.nix
new file mode 100644
index 0000000..038d8d6
--- /dev/null
+++ b/home/nvim/default.nix
@@ -0,0 +1,93 @@
+{ pkgs, pkgs-unstable, ... }:
+
+{
+ programs.neovim =
+ let
+ toLua = str: "lua << EOF\n${str}\nEOF\n";
+ toLuaFile = file: "lua << EOF\n${builtins.readFile file}\nEOF\n";
+ in
+ {
+ enable = true;
+ defaultEditor = true;
+ viAlias = true;
+ vimAlias = true;
+ vimdiffAlias = true;
+ extraPackages = with pkgs-unstable; [
+ inotify-tools
+
+ # debuggers
+ delve # golang debugger
+ lldb # rust, c, etc, debugger
+
+ # format
+ rustfmt
+ dprint # platform for many formatters
+ yamlfmt
+
+ # LSP
+ biome # javascript, biome
+ clippy # rust error checking
+ clang-tools # C
+ dprint # format engine for multiple langeuages
+ dprint-plugins.dprint-plugin-markdown # markdown
+ dprint-plugins.dprint-plugin-toml # toml
+ dprint-plugins.g-plane-malva # css
+ dprint-plugins.g-plane-markup_fmt # html
+ dprint-plugins.g-plane-pretty_yaml # yaml
+ fish-lsp # fish
+ gopls # golang
+ ltex-ls # latex, markdown
+ lua-language-server # lua
+ nil # lsp server for nix
+ nodePackages.bash-language-server # bash
+ nodePackages.typescript-language-server # javascript validation
+ ruff # python format and lint
+ rust-analyzer
+ tex-fmt # latex
+ texlab # latex lsp
+ tree-sitter # generate tree-sitter grammars
+ ty # python type checker written in rust
+ vale-ls # prose (md, asciidoc)
+ ];
+
+ extraPython3Packages = ps: [
+ ps.debugpy
+ ps.pynvim
+ ];
+ plugins = with pkgs-unstable.vimPlugins; [
+ {
+ plugin = nvim-dap;
+ config = toLuaFile ./plugins/dap.lua;
+ }
+ {
+ plugin = which-key-nvim;
+ config = toLuaFile ./plugins/which.lua;
+ }
+ {
+ plugin = undotree;
+ config = toLuaFile ./plugins/undotree.lua;
+ }
+ {
+ plugin = mini-nvim;
+ config = toLuaFile ./plugins/mini.lua;
+ }
+ {
+ plugin = nvim-treesitter.withAllGrammars;
+ config = toLuaFile ./plugins/treesitter.lua;
+ }
+ hardtime-nvim
+ nvim-dap-view
+ nvim-dap-virtual-text
+ nord-nvim
+ ];
+
+ extraLuaConfig = ''
+ ${builtins.readFile ./lsp.lua}
+ ${builtins.readFile ./autocommands.lua}
+ ${builtins.readFile ./keymaps.lua}
+ ${builtins.readFile ./options.lua}
+ ${builtins.readFile ./plugins/other.lua}
+ '';
+ };
+
+}