nixvim: neovim for NixOS
Love NixOS but hate setting up Neovim? Nixvim is here to help!
Nixvim: nixvim
Documentation: Docs
you can use nixvim as home-manager module, standalone flake, as nixos module ....
here is my config as a standalone flake: nixvim-flake
Archived post. New comments cannot be posted and votes cannot be cast.
Best
Open comment sort options
Best
Top
New
Controversial
Old
Q&A
since we are listing ways to swap to nixos,
https://github.com/BirdeeHub/nixCats-nvim
want to swap to nix but enjoy setting up neovim in lua, like, actual normal config structure not lua in nix strings?
Boths ways are great, if you like a distro, you will love nixvim. If you like to make a custom config starting from kickstart, this may be more your style.
The nvim config is an example, the templates will be 2 nix files, only 1 of which you will need to use commonly for downloading stuff, and 1 for overlays, for you to put into your normal config directory.
Great to here that project like this exist, i personally like nixvim more cuz i really never tried neovim, my starting point was nixvim...
All good! as I said, if you like a distro, nixvim is great. If you dislike a distro and want to do it yourself, nixCats will allow you to have a normal config structure and not worry about how to pass info needed from nix to lua when/if required.
I made nixCats for myself. My main config uses the nixExpressionFlakeOutputs template from the nixCats repo.
But it turned out too good, I had to make it easily consumable for people. So I wrote a bunch of help and stuff and took the time to fix up all the loose ends.
The lua in the repo is completely arbitrary, its just a stripped down version of my config, minus my weird alt+j alt+k alt+l autocomplete keybinds XD. Use your own config, add the plugins to the lists to download them, set up with the default setup functions provided by the plugin, or use the lazy.nvim wrapper (the lazy.nvim wrapper just gives it a list of plugins downloaded via nix to load locally, and does the rtp reset in a way that wont delete all your treesitter grammars)
I'm a bit late to the party, but just discovered nvf. I am/was a relatively happy user of
nixvim, which is still a very nice project.nvfseems to hit a sweet spot betweennixCatsandnixvim, which for me seemed to automatically address some dependency issues (mostly in the form of regressions after updates) I had withnixvim. While some attribute categories seem to be somewhat arbitrary innvf, in general I seem to get less boiler plate than withnixvim, especially for plugins that are not yet "wrapped" into module options. Also usage indevShells (while I haven't tried it yet) seems to be possible quite naturally in a composable manner. (I might try something like pulling in a basic nvim config in adevShellflake from an external flake input, and extend it with some project specific plugins and use it withdirenv.nvfseems to support such a use case nicely.)Yeah I would say that nixvim tries to do too much for people, leaving them lost when it hasnt done something yet. I find distributions like lazyvim do the same thing. So I went for nixCats which handles the wiring from nix to lua but does nothing for you as far as neovim itself is concerned, it just gives you all the levers and includes your config.
Its good to hear there is something in between these options, although I prefer the route I took with nixCats, which is why I made it :) Specifially I like my approach with nixCats because it does as much as possible without me having to be responsible for fixing anything to do with people's plugin configurations while maintaining nixCats, meaning less updates and less breaking changes because a new plugin will never cause nixCats to become broken, because I dont touch the plugins.
If nvf gives you the sweet spot between having some stuff configured for you and still being able to add new stuff without waiting for it to be wrapped, im happy for you, thats really cool :)
Hi !
I'm one of the nixim maintainers. Feel free to ask any question :)
Glad you like it u/CountyMinute821 !
Thanks sir...
Thanks for making it! I have been using it for some time, and it works great.
I think the most painful part of configuring neovim is the various lsp configurations, I just copy paste from lsp-config and hope that it works. Can nixvim make lsp configuration easier?
Yeah it's very easy just have to like lsp.pyright.enable = true; Also u won't have any problems with lsp confict etc..
Yes, indeed. This is one of the best advantages with using nixvim.
Getting LSP support for a language is as easy as doing `plugins.lsp.servers.clangd.enable = true`.
It installs the language server and configures `lspconfig-nvim` for you.
But isn’t a layer of abstraction on top of the configuration syntax already existing an issue? It means that these will have to be kept in sync.. 🤔
your configuration files are generated from the nixos configuration when you rebuild
Comment deleted by user
This isn't really a version of neovim, it is just a way of defining the config with nix, though wrapped around a specified neovim package. A few of the advantages I get from this is any external packages or commands I run from within neovim are managed by nix, I can define my neovim config as a separate flake and instantly get my custom config on any machine with
nix run github:me/mynixvim.if u want any guide feel free to join nixvim matrix channel links are on github
Comment deleted by user
Alpha with startify theme
This project is awesome and while I think I will switch to nix/nixOS in the future, I do not think I will ever fully switch my nvim config to nix.
Another layer of abstraction on top of the neovim configuration is not something I wish, but to each their own.
Nix is awesome and this makes using vim on nix easier so thanks !
How to configure the plug-ins? If you use it as it is, it's great, but what about custom settings or tweaks? (like when two plug-ins conflict with each other)
As a new comer to linux, those kinds of guides help very much. Thank you!
Feel free to ask anything on nixvim matrix channel
Yes! I use NixVim and it is the way! Makes configuring Vim soooo much easier!
great to hear.... enjoy!
I caught wind of this project after some setup fatigue with my neovim config. Great work, and I can't wait to get into some trouble with it tomorrow!
I’m new to configuring nvim and have been doing so with nixvim the past week. It’s going well and enjoying it. Not easy for me to understand their documentation though.
need help join the matrix channel of nixvim, links are on github..
I love both NixOS and (setting up) Neovim
nixvim makes it easy to setup..
It looks amazing. I am using it from past 2 months
enjoy!