Visual Studio Code: Difference between revisions
imported>Atry No edit summary |
imported>Atry No edit summary |
||
Line 189: | Line 189: | ||
Then run `nixos-rebuild switch` to enable `nix-ld`. Unlike the `nix-vscode-server` solution, `nix-ld` solution also enables VSCode extensions even if they include non-Nix binaries. | Then run `nixos-rebuild switch` to enable `nix-ld`. Unlike the `nix-vscode-server` solution, `nix-ld` solution also enables VSCode extensions even if they include non-Nix binaries. | ||
=== | === Nix-sourced VS Code to NixOS host === | ||
If vscode-remote is installed from nix (vscode-extensions.ms-vscode-remote as above) on the client machine, everything should "just work". | |||
== Remote WSL == | |||
Similar to SSH hosts, both <code>nix-vscode-server</code> and <code>nix-ld</code> solution allows a VSCode Windows client to connect a [https://github.com/nix-community/NixOS-WSL NixOS-WSL] host. However, by default the VSCode Windows client uses <code>wsl.exe --exec</code> to start the code server, which bypasses NixOS environment variables required by <code>nix-ld</code>, resulting in failures. As a workaround, add the following settings for the VSCode Windows client: | Similar to SSH hosts, both <code>nix-vscode-server</code> and <code>nix-ld</code> solution allows a VSCode Windows client to connect a [https://github.com/nix-community/NixOS-WSL NixOS-WSL] host. However, by default the VSCode Windows client uses <code>wsl.exe --exec</code> to start the code server, which bypasses NixOS environment variables required by <code>nix-ld</code>, resulting in failures. As a workaround, add the following settings for the VSCode Windows client: | ||
Line 201: | Line 205: | ||
See https://github.com/nix-community/NixOS-WSL/issues/222 for the discussion about <code>wsl --exec</code> issue on NixOS-WSL. | See https://github.com/nix-community/NixOS-WSL/issues/222 for the discussion about <code>wsl --exec</code> issue on NixOS-WSL. | ||
== Using nix-shell == | == Using nix-shell == |