I’m currently trying to set up a dev environment for using visual studio code with .NET and the language server. Attached is my flake.nix:
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = {self, nixpkgs, ...}: let
system = "x86_64-linux";
in {
devShells."${system}".default = let
pkgs = import nixpkgs {
inherit system;
};
in pkgs.mkShell {
packages = with pkgs; [
dotnetCorePackages.dotnet_9.sdk
dotnetCorePackages.dotnet_9.runtime
omnisharp-roslyn
icu.dev
];
};
};
}
I also have the C# and C# dev tools installed in my vscode setup, and I attempted in the JSON settings to manually point the LSP to the omnisharp path. However I usually get an error approximating something like this:
.NET server STDERR: Could not start dynamically linked executable: /home/tornado711/.vscode/extensions/ms-dotnettools.csdevkit-1.16.6-linux-x64/components/vs-green-server/platforms/linux-x64/node_modules/@microsoft/visualstudio-server.linux-x64/Microsoft.VisualStudio.Code.Server
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld
.NET server exited with 127
I’m linking to the LSP path which I have installed via nix, so I’m not sure why I’m getting this error, it seems like potentially its still trying to link to a different LSP? Has anyone had issues getting .NET in vscode set up similar to this before?