Skip to content

Commit

Permalink
add docs for vscode server
Browse files Browse the repository at this point in the history
  • Loading branch information
nzbr committed May 28, 2024
1 parent cdf6cd9 commit 63e7523
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- [Design](./design.md)
- [Building](./building.md)
- [How-To](./how-to/README.md)
- [Setup VSCode Remote]()
- [Setup VSCode Remote](./how-to/vscode.md)
- [Change the username](./how-to/change-username.md)
- [Setup Nix Flakes](./how-to/nix-flakes.md)
- [Troubleshooting](./troubleshooting/README.md)
Expand Down
41 changes: 41 additions & 0 deletions docs/src/how-to/vscode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Setup VSCode Remote

The VSCode Remote server can not be run as-is on NixOS, because it downloads a nodejs binary that
requires `/lib64/ld-linux-x86-64.so.2` to be present, which isn't the case on NixOS.

There are two options to get the server to run. Both options require `wget` to be installed:

```nix
environment.systemPackages = [
pkgs.wget
];
```

## Option 1: Set up nix-ld

[nix-ld](https://github.com/Mic92/nix-ld) is a program that provides `/lib64/ld-linux-x86-64.so.2`,
allowing foreign binaries to run on NixOS.

Running the VSCode server on NixOS-WSL requires using [nix-ld-rs](https://github.com/nix-community/nix-ld-rs), instead of the regular nix-ld.

To set it up, add the following to your configuration:

```nix
programs.nix-ld = {
enable = true;
package = pkgs.nix-ld-rs;
};
```

## Option 2: Patch the server

The other option is to replace the nodejs binary that ships with the vscode server with one from the nodejs nixpkgs package.
[This module will set up everything that is required to get it running](https://github.com/K900/vscode-remote-workaround/blob/main/vscode.nix).
If you are [using flakes](./nix-flakes.md), you can add that repo as a flake input and include it from there.
Otherwise, copy the file to your configuration and add it to your imports.

Add the following to your configuration to enable the module:

```nix
vscode-remote-workaround.enable = true;
```

0 comments on commit 63e7523

Please sign in to comment.