Patch VSCode with nix-ld

Hello,
I’m trying to get the Microsoft Serial Monitor extension to work in VSCode. I’m currently on NixOS 24.05 running VSCode 1.92. When trying to start the serial monitor it gets stuck in loading and in the extension host i get the following output:

2024-11-13 21:12:32.625 [error] Activating extension ms-vscode.vscode-serial-monitor failed due to an error:
2024-11-13 21:12:32.625 [error] Error: libstdc++.so.6: cannot open shared object file: No such file or directory

Now as far as i can tell its an issue with a dynamic library. After a bit of googling i got a hit for a similar issue with Python where the solution is to fix it with nix-ld.
Currently I have vscode installed with home-manager and a dozen extensions and I’m not sure how to get this patch into my configuration.nix. Has anyone any tips?
Thanks in advance.
Moge

Not sure exactly what you are looking for but you can see my setup for how to add nix-ld

You might need:

   nix-ld = {
      enable = true;
      libraries = with pkgs; [
        stdenv.cc.cc.lib
        zlib # numpy
       ];
};

Thanks for your response:)
When I add the follwing lines to my nix config

  environment.systemPackages = with pkgs; [
   ... 
   nix-ld
  ];

  environment.stub-ld.enable = false;

  programs.nix-ld = {
    enable = true;
    libraries = with pkgs; [
      stdenv.cc.cc.lib
      zlib
    ];
  };

Then im still getting the same error message as before. And if its possible i’d like to only use nix-ld within the vscode package and not globally on my system.

Same, or ideally not even then, of course.

I suspect the only way this would be possible is with a vscode wrapper, at which point you might as well use the FHS wrapper.