Error when opening VSCode Remote terminal pane on NixOS host

I’m using VSCode Remote SSH to connect to a NixOS host. I haven’t changed anything on the NixOS host side since my last successfully connection. However now, presumably after updating VSCode, I’m seeing an error whenever I attempt to open the terminal pane:

cannot execute /home/skainswo/dev/nixpkgs: NIX_LD or NIX_LD_x86_64-linux is not set

and then an error window stating

The terminal process "/run/current-system/sw/bin/zsh" terminated with exit code: 1.

However, when I test this out via SSH it works just fine:

$ ssh my-machine

skainswo in doodoo in ~
❯ /run/current-system/sw/bin/zsh

skainswo in doodoo in ~
❯ exit

skainswo in doodoo in ~ took 8s
❯ /run/current-system/sw/bin/zsh --version
zsh 5.8.1 (x86_64-pc-linux-gnu)

Any idea what might be causing this? Presumably it’s some kind of NIX_LD issue, but why would that cause zsh to fail to start? And why only in VSCode?

nix-ld shouldn’t be coming into play when running a nix-packaged executable. Why exactly is it trying to run /home/skainswo/dev/nixpkgs? What’s actually at that path?

That’s the folder that I have open in VSCode. It’s not clear to me why it’s trying to execute that path…

Also weird is that I don’t actually have nix-ld enabled on my system!

VSCode remote over ssh isn’t using the nix packaged binary on the remote host. It downloads the code server setup and runs it on the remote system.

I’ve never used nix-lxd, but have you tried disabling it?

Are you using something like this, which is necessary to patch the server VSCode is trying to run? GitHub - msteen/nixos-vscode-server: Visual Studio Code Server support in NixOS

That’s correct, but it is configured to run the zsh binary from Nix, and linked to /run/current-system/sw/bin/zsh.

Yup, nix-ld is not enabled on my system.

Yup, I’ve got that set up! Maybe something fishy is going on there though?

Oops, sorry I misread this.

You could try disabling the nixos-vscode-server, but at best you’ll get a different failure. :frowning:

Hosted by Flying Circus.