nixos-vscode-server icon indicating copy to clipboard operation
nixos-vscode-server copied to clipboard

Add option to use an FHS wrapped NodeJS

Open MatthewCash opened this issue 2 years ago • 2 comments

This should fix the source of the problem that #11 addresses. Instead of automatically invoking patchelf, which seems quite scary, I wrapped the NodeJS that vscode-server uses in an FHS environment. This allows any subprocesses (e.g. extensions, terminals) to also run in an FHS environment.

Since the NodeJS that vscode-server uses is already replaced by the systemd unit, all I had to do was create a new FHS derivation, made quite easy with pkgs.buildFHSUserEnv. I copied the targetPkgs from https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/applications/editors/vscode/generic.nix#L181 so that the environment will be nearly identical to a local vscode-fhs.

MatthewCash avatar Feb 07 '22 23:02 MatthewCash

Awesome work! I had not expected it to be this straight forward. Though part of me wants to just merge straight away, I ought to test it first, so when I have the time to do so properly, I will merge. Well done!

msteen avatar Feb 08 '22 06:02 msteen

I tested a rebased version of this PR with the C/C++ extension and it worked.

lopsided98 avatar Jun 15 '22 15:06 lopsided98

I tested a rebased version of this PR with the C/C++ extension and it worked.

Seconded. There is a verbose prompt for the terminal inside VSCode but other than that it seems to work as expected.

thrifty-txt avatar Oct 12 '22 19:10 thrifty-txt

I can make a pull request for my rebased version if that would help merge this feature in, it was very helpful for me as I'm developing in WSL.

thrifty-txt avatar Oct 12 '22 19:10 thrifty-txt

@msteen Is it ok to merge besides the conflicts?

javacafe01 avatar Feb 07 '23 12:02 javacafe01

Yeah, you're right, this merge needs to happen. Versions change too often and people might need different versions depending on their version of VS Code. I hardly use NixOS at the moment, but I do use this project on one server, and I like it to keep working, so I will see if I can find time this week to work this PR in the project and test it.

msteen avatar Feb 07 '23 13:02 msteen

@MatthewCash Thanks again for your contribution! Your work was fital in making the extension work again for version 1.75 of VS Code and has been included in #42.

msteen avatar Feb 10 '23 22:02 msteen