From 1d7b04a71c7222153ffa9cd48f73b51ea72204d1 Mon Sep 17 00:00:00 2001 From: seth Date: Sat, 18 Feb 2023 05:13:27 -0500 Subject: major refactor - `mkHost` now accepts an optional `specialArgs` argument to be passed to `nixosSystem()` - the `modules` argument for `mkHMUser` is now optional --- users/seth/programs/neovim/default.nix | 148 +++++++++++++-------------------- 1 file changed, 60 insertions(+), 88 deletions(-) (limited to 'users/seth/programs/neovim/default.nix') diff --git a/users/seth/programs/neovim/default.nix b/users/seth/programs/neovim/default.nix index 58d8071..0f814be 100644 --- a/users/seth/programs/neovim/default.nix +++ b/users/seth/programs/neovim/default.nix @@ -1,99 +1,71 @@ -{ - config, - pkgs, - ... -}: let - neovimConfig = - if config.seth.devel.enable - then "vim.g.use_lsp_plugins = true" - else "vim.g.use_lsp_plugins = false"; - - lspPackages = - if config.seth.devel.enable - then - with pkgs; [ - alejandra - clang - codespell - deadnix - nodePackages.alex - nodePackages.bash-language-server - nodePackages.prettier - nodePackages.pyright - pylint - rust-analyzer - rustfmt - statix - stylua - sumneko-lua-language-server - yapf - ] - else []; - - lspPlugins = - if config.seth.devel.enable - then - with pkgs.vimPlugins; [ - nvim-lspconfig - null-ls-nvim - plenary-nvim - nvim-treesitter.withAllGrammars - nvim-cmp - cmp-nvim-lsp - cmp-buffer - cmp-path - cmp-vsnip - vim-vsnip - luasnip - cmp_luasnip - trouble-nvim - telescope-nvim - gitsigns-nvim - editorconfig-nvim - ] - else []; -in { +{pkgs, ...}: { programs.neovim = { enable = true; - extraPackages = lspPackages; - plugins = with pkgs.vimPlugins; - [ - barbar-nvim - catppuccin-nvim - lightspeed-nvim - lualine-nvim - nvim-tree-lua - nvim-web-devicons - ] - ++ lspPlugins; + extraPackages = with pkgs; [ + alejandra + clang + codespell + deadnix + nodePackages.alex + nodePackages.bash-language-server + nodePackages.prettier + nodePackages.pyright + pylint + rust-analyzer + rustfmt + statix + stylua + sumneko-lua-language-server + yapf + ]; + plugins = with pkgs.vimPlugins; [ + barbar-nvim + catppuccin-nvim + cmp-nvim-lsp + cmp-buffer + cmp_luasnip + cmp-path + cmp-vsnip + editorconfig-nvim + gitsigns-nvim + lightspeed-nvim + lualine-nvim + luasnip + nvim-cmp + nvim-lspconfig + null-ls-nvim + nvim-tree-lua + nvim-treesitter.withAllGrammars + nvim-web-devicons + plenary-nvim + telescope-nvim + trouble-nvim + vim-vsnip + ]; }; xdg.configFile.nvim = { - source = ./config; + source = ./lua; recursive = true; }; xdg.configFile."nvim/init.lua" = { - text = - neovimConfig - + '' - - local cmd = vim.cmd - local opt = vim.opt - - require("getchoo") - - -- text options - opt.tabstop = 2 - opt.shiftwidth = 2 - opt.expandtab = false - opt.smartindent = true - opt.wrap = false + text = '' + local cmd = vim.cmd + local opt = vim.opt + require("getchoo") + vim.g.use_lsp_plugins = true + -- text options + opt.tabstop = 2 + opt.shiftwidth = 2 + opt.expandtab = false + opt.smartindent = true + opt.wrap = false - -- appearance - opt.syntax = "on" - cmd("filetype plugin indent on") - opt.termguicolors = true - vim.api.nvim_command("colorscheme catppuccin") - ''; + -- appearance + opt.syntax = "on" + cmd("filetype plugin indent on") + opt.termguicolors = true + vim.api.nvim_command("colorscheme catppuccin") + ''; }; } -- cgit v1.2.3