ayamir / nvimdots

A well configured and structured Neovim.
BSD 3-Clause "New" or "Revised" License
2.82k stars 451 forks source link

[RFC] Smarter package management #1293

Open Jint-lzxy opened 2 weeks ago

Jint-lzxy commented 2 weeks ago

Feature description

As briefly discussed in #1252, there are several cases where Mason is simply dead and can't be used at all. My specific situation is that most of the pre-built binaries can't run on FreeBSD (of course), and Linux-emulation mode doesn't really help either. I need to constantly symlink the "correct" executables to Mason's bin directory to make things work, but that's laborious, and I really don't wanna do that anymore. imo we need a way to either bypass Mason completely or make it optional for OSs like NixOS and the BSDs.

Additional information

No response

vollowx commented 1 week ago

The LSP servers, linters and formatters can actually be installed in system-wide on most systems, which means they are executable everywhere and maybe we just don't need mason at all?

Jint-lzxy commented 1 week ago

The LSP servers, linters and formatters can actually be installed in system-wide on most systems, which means they are executable everywhere and maybe we just don't need mason at all?

Exactly! Initially, I was thinking of completely removing Mason, but without it, we'd lose the ability to automatically install those dependencies on a freshly installed system, which is kinda like the two sides of the same coin lol

vollowx commented 1 week ago

Maybe ask user whether to install stuffs manually or by mason, store the choice and enable mason if that is true ?

Jint-lzxy commented 1 week ago

Maybe ask user whether to install stuffs manually or by mason, store the choice and enable mason if that is true?

Yeah that's what I meant by "optional," but ideally, I'd like to find a way to automatically bypass Mason without any user interaction. In my case, I'd love Mason to be available on my Mac, but to be automatically disabled on my FreeBSD workstation. Especially in jails when I'm doing certain experimentation, I certainly don't wanna specify that option manually lmao

CharlesChiuGit commented 1 week ago

In my case, I'd love Mason to be available on my Mac, but to be automatically disabled on my FreeBSD workstation.

Maybe we can add an option as "platform" in our custom lazy.nvim loader and utilized the enabled flag in lazy.nvim? If platform = {"XXX OS" = false} is not set, then it will default to install the plugin on whatever OS it's on. I personally would like to disable sniprun on windows since it could not be installed on windows lol

https://github.com/folke/lazy.nvim?tab=readme-ov-file#-plugin-spec

Jint-lzxy commented 1 week ago

Maybe we can add an option as "platform" in our custom lazy.nvim loader and utilized the enabled flag in lazy.nvim? If platform = {"XXX OS" = false} is not set, then it will default to install the plugin on whatever OS it's on. I personally would like to disable sniprun on windows since it could not be installed on windows lol

lol that's a great idea! Tho we'll need a way to automatically register those sources with lspconfig/none-ls/dap then.

Jint-lzxy commented 1 day ago

After some consideration, I've decided to create a plugin that automates the control of those "bridging plugins" (like mason-null-ls.nvim). I'll share the link to the Reddit post here once it's completed lol