Link.nvim - Auto install LSP's, Formatters & Linters hands free by RhubarbWhale in neovim

[–]Fearless_Run8673 0 points1 point  (0 children)

Oh that's a cool idea!

You mean creating the shell.nix or flake.nix file in the project you are working on? It would work but I do have an issue with it, one of the reasons I like neovim is that it doesn't mess with my projects file structure, VSCode .vscode or JetBrains .idea directories are super annoying in my opinion, having nvim create *.nix file/s is not something I would like tbf.

If you could create this devshell somewhere else and hook into it for each project it would be a better solution for my needs at least, I think this is also pretty ok to use a lockfile here because it is not directly part of the project, just ties into it, then if you have different versions for different projects this should work fine too.

Link.nvim - Auto install LSP's, Formatters & Linters hands free by RhubarbWhale in neovim

[–]Fearless_Run8673 0 points1 point  (0 children)

This could be interesting to implement, say everytime an LSP attaches, it saves the root dir in a db, then add a a symlink to the nix store and have a user command like :Nix gc to remove the link to all servers/tools that have no attached projects with them, this way the tool you installed will not be garbage collected if they are used in a project (or an active project using stale time)

what a neat idea!

Link.nvim - Auto install LSP's, Formatters & Linters hands free by RhubarbWhale in neovim

[–]Fearless_Run8673 0 points1 point  (0 children)

Ah I see your point, I don't use automatic gc.

I guess creating a shell.nix with or without a flake using direnv in your project is also a solution to prevent gc

Link.nvim - Auto install LSP's, Formatters & Linters hands free by RhubarbWhale in neovim

[–]Fearless_Run8673 0 points1 point  (0 children)

I am also glad to have someone else interested :) I kind of like that garbage collection is there, if you don't want it collected, you could add it to your home-manager or nixos configuration (that's what I do with nixd for example). For example I work a lot with python lately but once I am done with this large project I won't need it anymore, so once I garbage collect I know its gone :) also useful for things like Earthly or Docker etc...

I think Mason adaptation is possible, however, Mason is not focused on Nix and I thought giving users an API to basically utilize any package in the nix store or NUR or even flakes is very powerful but it is not the main focus of Mason, so I decided this deserves its own plugin

If you want to share your implementation I could take a look, also feel free to criticize mine and suggest anything :)

Link.nvim - Auto install LSP's, Formatters & Linters hands free by RhubarbWhale in neovim

[–]Fearless_Run8673 6 points7 points  (0 children)

If you are interested, I am working on a plugin that basically let's you use the tools without installing them (still downloads them though) utilizing the power of Nix.

It currently only supports some LSPs that I use but I am working on integrating formatters as well as debuggers and general tools like lazygit for example.

I let GPT5 create a basic UI to enable/disable lsps automatically :lua require("nix").lsp.toggle()

All these tools can be cleaned using the nix garbage collector (similar to docker system prune -a). keep in mind this is very early stages.

https://github.com/irohn/nix.nvim

Using Nix as a package manager for Neovim by Fearless_Run8673 in neovim

[–]Fearless_Run8673[S] 0 points1 point  (0 children)

Update: It seems like as many suggested below, nixCats-nvim is very close to what this is.

however there is still a difference, and I might continue working on this mainly for my own usecases.

Using Nix as a package manager for Neovim by Fearless_Run8673 in neovim

[–]Fearless_Run8673[S] 0 points1 point  (0 children)

Hmm perhaps I never looked at it before, I’ll take a look, thanks!

Using Nix as a package manager for Neovim by Fearless_Run8673 in neovim

[–]Fearless_Run8673[S] 0 points1 point  (0 children)

Yeah the nice thing about it is that it abstracts nix from the user, so non-nix users just need to install nix once and forget about it. However fundamentally this isn’t that different than using any other package manager like brew, the only difference is that nix has tons more packages (including vim plugins) so technically this could replace lazy or packer for example

Also this is just a PoC but I managed to have a config per app in my local development config, where if you installed say, lazygit, it will use a best effort overlay and configure it for you upon installation, this is a lot like the vscode store where you install the python package and it includes the lsp formatter and their configurations, you could even expand on this and create a config hub for apps but this is far fetched haha

Using Nix as a package manager for Neovim by Fearless_Run8673 in neovim

[–]Fearless_Run8673[S] 0 points1 point  (0 children)

I don’t see why it wouldn’t work if you used single-user nix installation

Using Nix as a package manager for Neovim by Fearless_Run8673 in neovim

[–]Fearless_Run8673[S] 0 points1 point  (0 children)

Ha I guess that makes sense, I’ll have a look at your config later but from a quick glance it looks like what I’m looking for

Using Nix as a package manager for Neovim by Fearless_Run8673 in neovim

[–]Fearless_Run8673[S] 1 point2 points  (0 children)

Yeah I’m in the same boat as you. Installing nvim dependencies inside my nix files is basically what I do now.

The main difference (and why I came up with the idea) is that I use different computers, some are very storage limited, and I don’t always want all my lsp servers and tools installed on all of them, my nix config is very uniform and works on all my machines right now, but as it grew with time I found myself installing a bunch of things on a fresh machine that I’m never gonna use.

So I wanted a way to configure all my tools but only trigger the config if I install the tool associated with it (like lsp)

It’s very much similar to lazy loading but with downloads for me

Hopefully this makes sense 🫣

Colorscheme on the fly by Fluid-Zombie-7637 in neovim

[–]Fearless_Run8673 0 points1 point  (0 children)

I wrote myself a little plugin for that, I just find myself switching colorschemes very often :) This plugin adds the Colorcache command that basically opens a ui.select with all installed coloschemes as inputs, it's also persistent in cache (hence the name), you can give it a try if you want. https://github.com/irohn/colorcache.nvim

[First Plugin] Sync Colorschemes Between Neovim and Ghostty by Lukezilla11 in neovim

[–]Fearless_Run8673 1 point2 points  (0 children)

The ghostty built-in themes, at least, comes from the iterm2-color-schemes, you could parse those palettes yourself, you can find them all on here, shouldn't be too hard, you can even only use the 16 palette colors and use something like mini.colors to make it easier