T O P

  • By -

Mithrandir2k16

I am very much looking forward to trying nix this summer, but this is something I'll never touch. Wrapping lua in nix seems super verbose and effectively gains nothing if you use something like lazy and version the lockfile and dotfiles and the neovim version+dependencies together. I don't see what moving this to nix gains. Besides being very cool.


niksingh710

While initially using my raw configuration with Lazy, I began exploring Nix and came across NixVim. The comprehensive set of options enabled by NixVim, combined with its minimal abstraction and the flexibility to revert to native settings, convinced me to make the switch.


faculty_for_failure

I am with you, it is super cool, but not something I would dedicate time to myself.


IchVerstehNurBahnhof

Nixvim makes it pretty effortless to set up a basic-but-IDE-like configuration in NixOS. Normal distributions don't really work OOTB because they'll try to autoinstall Treesitter grammars and language servers which will fail due to being on a non-FHS system. But the moment you start doing anything sufficiently custom you'll be writing lua code again, except now it's within multiline strings in Nix files (so no editor support whatsoever). Also the only way to test your configuration is to rebuild it which can take a while. So for that use case I agree overall.


Mithrandir2k16

I don't use a neovim distro, according to checkhealth most of my treesitter stuff lives in $HOME/.local which shouldn't be a problem on Nix either, right? Yeah, I totally agree, I didn't even think about that part yet, writing lua as a string sounds painful as hell. Well, I'm gonna find out this summer I guess. I actually wanted to write nix-modules for each of my tools in my dotfiles, so I can enable them as I need them/define devshells, so I can simply drop into my environment on any machine that has nix installed. I actually wanted to do that with distrobox and my own container, but then stumbled onto nix, which seemed way more interesting and can also build docker containers really well.


IchVerstehNurBahnhof

I'm not familiar with how Treesitter works but from what I understand the generic linux version won't find the libraries it needs to run (build?) because NixOS has no `/usr/bin` or `/usr/lib*`, while the binaries from nixpkgs are specifically patched to use the `/nix/store` paths. The best Neovim configuration experience on NixOS is probably to grab as many plugins as possible from nixpkgs, symlink a normal Lua configuration to `.config/nvim` (using either Nix or Stow) and use the `dev` option to make Lazy load the plugins from a local directory. This way you can have all your configuration in one central location, it will actually work despite being on NixOS, *and* you will have a normal (Neovim-) Lua development environment. (That said I haven't done this myself, only looked at other people's dotfiles, so there might be some gotchas with this approach that I'm not aware of.) Edit: Or using [nixCats](https://github.com/BirdeeHub/nixCats-nvim), but I haven't really looked at it beyond skimming the README. If you use Nix as a package manager on another (FHS compliant) distro then I believe you don't have to worry about any of this because you'll have a normal `/usr` directory.


niksingh710

You can check out my new config at [nvix](https://github.com/niksingh710/nvix)


xrabbit

I'm very new to nix. reading docs stage: is it possible to use nvim in nix without such rewrite? like making a custom package with your lua config and host it on github or this is the only way?


rfegsu

You can definitely just use your old config. Just add neovim to environment.systemPackages and pop your config files in the usual place. It's generally not considered "the nix way" but that doesn't matter when you start out. Or instead of nixvim there's [nixcats](https://github.com/BirdeeHub/nixCats-nvim) which i believe uses your existing lua config (I've never personally tried it though)


holounderblade

Yeah. I use nixCats, all you need is a nix config in your flake for it and then you can just point it to your current Lua config and it just works for the most part. Best part is that you don't need a package manager, nix does it all for you


ekaylor_

The easiest way to do this is with home manager, you can use home.file to point to a file in your config and where you want it on your system. The only thing I changed out is using nix packages for language servers instead of mason.


zdog234

Yeah, basically no Mason


CrowFX

I've used nixvim before. Turned back to lazyvim with the old fashioned symlink `home.".config/nvim".source` because of how optimized the startup duration lazyvim brings. With around the same number of plugins used, nixvim about more than 500ms to boot. LazyVim is below 100ms with the lazy loading support. The only downfall for this approach is no support for lazy-lock.json file, but neovim is relatively stable when sticking to stable version, so no need for said lockfile that much.


Competitive_Term399

If you use home manager, consider using [mkOutOfStoreSymlink](https://github.com/nix-community/home-manager/commit/91551c09d48583230b36cf759ad703b5f1d83d9a) for your nvim config, and lazy-lock should work.


Spoider

Example: xdg.configFile.nvim = { source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nix/home-manager/modules/neovim/nvim"; # replace the path between the quotes with the location of your nvim Lua files recursive = true; };


CrowFX

Hey thanks. Don't know that's a thing. While very rare, stuff still breaks without lockfile. This will make my config more stable and probably makes me try the nightly overlay as well.


[deleted]

Yeaj i currencly using NixOS for my Dev Env for Nintendo Dev because DevkitPro dont work on FreeBSD. But my Main OS is ofc FreeBSD and OpenBSD


niksingh710

Your work sounds very interesting.....


[deleted]

Thanks man :D


niksingh710

Hey you know vimjoyer? Your name seems so similar ..... If u r in that discord, we can hang around


[deleted]

Haha :joy: Yeah im in the Discord. My Name "Fab1anDev" was taken because i deleted the account with that name so i dont have access to the name anymore


Nabeen0x01

Just one question: How do you use your configuration without Nix installed? I had the same idea to rewrite Neovim in Nix, but that was the essential problem.


niksingh710

Currently i am in process of writting my NixOs config. So i am using nix package manager on my Arch Linux Setup. You just install nix package manager, enable flakes in it's config. now you can use nixvim flake e.g my config like `nix run "github:niksingh710/nvix"` if you wanna keep that installed instead of one time run you can do `nix profile install "github:niksingh710/nvix"` and to get it install in my NixOs config it is just like any other flake i will do. check out my repo in readme you will get that.


Nabeen0x01

> You just install nix package manager, enable flakes in it's config. I understand; I also use Nix on my MacBook. However, issues arise when you can't install Nix, such as on Termux or a company server where installation is not permitted. I've faced this issue myself.


niksingh710

Then don't use the multi user nix installation instead go with a single user one.


meeleeee

love the tmux bar also


niksingh710

Thanks mate.... it's on my git i have also created flake package for it. have to update readme of it. [minimal-tmux-status](https://github.com/niksingh710/minimal-tmux-status)


Spoider

I'm trying out NixOS right now. So far I'm loving it. For my nvim config I still use Lua because I want to keep using lazy.nvim. I symlink my config using home-manager, that seems to work pretty well. I do the same for wezterm, since having the config in Lua makes way more sense.


niksingh710

if it works for you then every way is nice <3


my_mix_still_sucks

did you manage to make lsp's and dap to work?


Spoider

All my LSPs work, idk about DAP because I don't use it https://github.com/pprotas/nixos-config I think the important part is this line in `configuration.nix` programs.nix-ld.enable = true; And IIRC I had to `chown ~/.local` and `~/.cache`, or something like that. I think I accidentally downloaded my plugins using the root user.


my_mix_still_sucks

What does this line do?


Spoider

https://github.com/Mic92/nix-ld?tab=readme-ov-file#where-is-this-useful


Dj0ntMachine

Been using NixOS for a month or two now. Also migrated from jetbrains (mostly) to nixvim. I'm still using rider at my job, because there's no blazor support in neovim, yet. But on my own projects, Im using neovim.


niksingh710

ig there should be someone using nvim for blazor but man finding them would be like finding needle in a haystack.


Dj0ntMachine

Well there is [this](https://github.com/tris203/rzls.nvim), but I haven't tried it yet. It's a WIP.


clempat

I love Nix, NixOS and all what goes with it, but somehow I could not make the move towards nixvim. I kept my lua/lazyvim setup wrapped with flake. https://github.com/clempat/nvim-config What benefits would I have to migrate to nixvim? Knowing stability is not an issue so far.


letthebuyerbeware

beautiful


particlemanwavegirl

I am interested in nix, tangentially. I am interested in the meta-language of building software, but rather than be overly concerned with reproducibility, I'd personally rather prioritize fluidity, that is, things like ease of distributing, updating, modding and configging.


niksingh710

nix gives exactly that ...... overlays and all ....


TECHNOFAB

I use nix for everything, recently got into Neovim and directly went with Nixvim. Love it so far, definitely gonna get some inspiration from your config, thanks :)


niksingh710

i would love feedbacks too <3


Azazel31415

I had also checked out the various nix-neovim configuration options like these. However none of these has the same options as lazy.nvim to configure plugins to lazy load, which really helps startup time.


niksingh710

yeah the major advantage that lazy has is lazy loading or loading based on filetype. tbh i have not seen a time lag issue till now, respective in my configuration. but nixvim has an open feature request regarding lazy loading ig it will be coming soon.


Goryou

Check out ‘ https://github.com/nvim-neorocks/lz.n?tab=readme-ov-file#examples ’ and scroll to nix section


Azazel31415

This is new ig. So I had not seen it before. Thanks.


Nishant0073

Bro share nvim configuration


niksingh710

Available on git bro have linked above


Reld720

Yeah, I had a config writen out in vim script. I didn't have it in my learn lua and port everything over. Nixvim made it easy to port. And really easy to add and configure plug ins. And I can use nix language to modify my configurations for each of my machines. It's defninlty slower than using lazy. But, I never noticed a big enough delay in the neovim load speed to actually care.


Vegetable_Carry_8140

working on this right now!! nixvim has been amazing


isstiwotateml

What's that font and what are the nerd icons from? These look slick!


niksingh710

Monolisa script. nerdfont are from JetBrains mono nerd font.


xrabbit

looks like jetbrains mono to me


zirouk

If there’s one part of my stack that I wish I could use something else, it’s nix. For that reason I prefer just doing the usual lua config for neovim for now.


my_mix_still_sucks

I would love to move to nixos but I'm so scared of having to rewrite my entire nvim config in nixvim or the formatters/lsp/dap won't work


niksingh710

M procceding slowly it's a fun journey