nixos-vscode-server
nixos-vscode-server copied to clipboard
Add option to use an FHS wrapped NodeJS
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
.
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!
I tested a rebased version of this PR with the C/C++ extension and it worked.
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.
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.
@msteen Is it ok to merge besides the conflicts?
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.
@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.