diff options
| author | seth <[email protected]> | 2023-02-18 05:13:27 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2023-02-18 05:13:27 -0500 |
| commit | 1d7b04a71c7222153ffa9cd48f73b51ea72204d1 (patch) | |
| tree | 3d794209be0e2311dc76337c09c2cb39c52f6afb /users/seth/programs/neovim/default.nix | |
| parent | 8a8059d9889afcbcd8a133b0b186e3a97ce7ac23 (diff) | |
major refactor
- `mkHost` now accepts an optional `specialArgs` argument to be passed to
`nixosSystem()`
- the `modules` argument for `mkHMUser` is now optional
Diffstat (limited to 'users/seth/programs/neovim/default.nix')
| -rw-r--r-- | users/seth/programs/neovim/default.nix | 148 |
1 files changed, 60 insertions, 88 deletions
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") + ''; }; } |
