diff options
| author | Stefan Weigl-Bosker <stefan@s00.xyz> | 2025-03-02 17:47:10 -0500 |
|---|---|---|
| committer | Stefan Weigl-Bosker <stefan@s00.xyz> | 2025-03-02 17:47:10 -0500 |
| commit | 3fb87c7b8b2377a2cfc0f6e2b858a5b4f96f49d6 (patch) | |
| tree | 7efef9eec4b626cbcfd1d1396cb6dee4c73c7783 /modules/neovim/default.nix | |
| parent | b5e3e6f12b41a9a1133744e139c5aa47d1bee006 (diff) | |
| download | home-3fb87c7b8b2377a2cfc0f6e2b858a5b4f96f49d6.tar.gz | |
update
Diffstat (limited to 'modules/neovim/default.nix')
| -rw-r--r-- | modules/neovim/default.nix | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix index ce1e6e0..971e2f3 100644 --- a/modules/neovim/default.nix +++ b/modules/neovim/default.nix @@ -1,50 +1,48 @@ { config, lib, pkgs, ...}: let cfg = config.modules.neovim; - lua = str: "lua << EOF\n${str}\nEOF\n"; - luaImport = file: "lua << EOF\n${builtins.readFile file}\nEOF\n"; in { options.modules.neovim = { - enable = lib.mkEnableOption "neovim"; + enable = lib.mkEnableOption "neovim"; }; - config = { - programs.neovim = lib.mkIf cfg.enable { + config = lib.mkIf cfg.enable { + xdg.configFile."nvim/lua" = { + source = ./nvim/lua; + recursive = true; + }; + + xdg.configFile."nvim/after" = { + source = ./nvim/after; + recursive = true; + }; + + programs.neovim = { enable = true; defaultEditor = true; viAlias = true; vimAlias = true; vimdiffAlias = true; plugins = with pkgs.vimPlugins; [ - { - plugin = nvim-lspconfig; - config = let - servers = [ - { name = "clangd"; } - { name = "zls"; } - ]; - in lua (pkgs.lib.strings.concatStrings (pkgs.lib.lists.forEach servers (s: "require('lspconfig')['${s.name}'].setup(${s.config or "{}"})\n"))); - } - (nvim-treesitter.withPlugins (p: with p; [ tree-sitter-nix tree-sitter-c + tree-sitter-cpp tree-sitter-lua tree-sitter-zig tree-sitter-markdown tree-sitter-markdown-inline ])) + blink-cmp + nvim-lspconfig base16-nvim telescope-nvim telescope-fzf-native-nvim ]; extraLuaConfig = '' - ${builtins.readFile ./settings.lua} - ${builtins.readFile ./keybinds.lua} - ${builtins.readFile ./lsp.lua} - ${builtins.readFile ./terminal.lua} + ${builtins.readFile ./nvim/init.lua} ''; }; }; |