Neovim can't start language servers

I’ve been using Neovim for a while now without any problem, but just today I’ve begun encountering an issue: it can’t launch language servers installed with Mason. It’s been able to do so in the past, and I’m not sure what’s changed, but so far both rust-analyzer and lua_lsp have crashed because NixOS complains about them being dynamic executables.

Should I just enable nix-ld to make it stop complaining, or is there possibly some config that would cause this?

Edit 1: I’ve enabled nix-ld without any actual libraries in the path as a bodge. Still interested in having a more sound solution to this, though.

Okay, so it’s not all of them… nil_ls is working just fine! So are jsonls and taplo.

As you noticed using Mason with nixos will be problematic. There are ways to patch the binaries but IMO the added complexity is not worth it. Nix is already a fantastic package manager so I would advice to install all the LSPs using nix.

If you want to use the same neovim configuration in systems without nix you can load mason conditionally only on those systems.