If you’re trying to set up csharp-ls with NixVim and Home-Manager, here’s a quick solution that worked for me.

To make it work seamlessly, I installed pkgs.dotnetCorePackages.sdk_8_0_2xx. While I didn’t dive too deeply into the details, it’s likely because this ensures that the same version of .NET is used across the system. This way, Nix can manage its version of .NET to compile your C# projects properly.

Here’s the relevant configuration snippet:

pkgs.dotnetCorePackages.sdk_8_0_2xx
#...

lsp = {
  enable = true;
  servers = {
    csharp-ls.enable = true;
  };
};

This setup enables Language Server Protocol (LSP) support for C# via csharp-ls.

With this in place, everything should work smoothly!