<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.nixos.org/w/index.php?action=history&amp;feed=atom&amp;title=Visual_Studio_Code%2Fen</id>
	<title>Visual Studio Code/en - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.nixos.org/w/index.php?action=history&amp;feed=atom&amp;title=Visual_Studio_Code%2Fen"/>
	<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=Visual_Studio_Code/en&amp;action=history"/>
	<updated>2026-07-29T04:19:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.nixos.org/w/index.php?title=Visual_Studio_Code/en&amp;diff=33731&amp;oldid=prev</id>
		<title>FuzzyBot: Updating to match new version of source page</title>
		<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=Visual_Studio_Code/en&amp;diff=33731&amp;oldid=prev"/>
		<updated>2026-07-16T15:36:31Z</updated>

		<summary type="html">&lt;p&gt;Updating to match new version of source page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{note|Visual Studio Code is [[FAQ/unfree|unfree]] because its license prohibits distribution. See the [[FAQ/unfree]] page to install unfree software.}}{{Infobox application&lt;br /&gt;
| name = Visual Studio Code&lt;br /&gt;
| type = Text Editor&lt;br /&gt;
| image = Visual_Studio_Code_1.35_icon.svg&lt;br /&gt;
| developer = Microsoft&lt;br /&gt;
| website = https://code.visualstudio.com/&lt;br /&gt;
| documentation = https://code.visualstudio.com/docs&lt;br /&gt;
| bugTracker = https://github.com/microsoft/vscode/issues&lt;br /&gt;
| github = https://github.com/microsoft/vscode&lt;br /&gt;
| programmingLanguage = TypeScript, JavaScript, HTML, CSS&lt;br /&gt;
| os = Linux, macOS, Windows&lt;br /&gt;
| initialRelease = 29 April 2015&lt;br /&gt;
}}&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Visual Studio Code&amp;#039;&amp;#039;&amp;#039; is a cross-platform text editor developed by Microsoft, built on the Electron framework.&lt;br /&gt;
&lt;br /&gt;
For the free distribution of the VS Code codebase (without MS branding, telemetry, and [https://marketplace.visualstudio.com/ extension marketplace] replaced by [https://open-vsx.org/ Open VSX]) see [[VSCodium]].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=nix&amp;gt;&lt;br /&gt;
environment.systemPackages = with pkgs; [ vscode ];&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extensions can be managed using {{Nixpkg|pkgs/applications/editors/vscode/with-extensions.nix|vscode-with-extensions}} :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nix&amp;quot;&amp;gt;environment.systemPackages = with pkgs; [&lt;br /&gt;
  (vscode-with-extensions.override {&lt;br /&gt;
    vscodeExtensions = with vscode-extensions; [&lt;br /&gt;
      jnoortheen.nix-ide&lt;br /&gt;
      ms-python.python&lt;br /&gt;
      ms-azuretools.vscode-docker&lt;br /&gt;
      ms-vscode-remote.remote-ssh&lt;br /&gt;
    ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [&lt;br /&gt;
      {&lt;br /&gt;
        name = &amp;quot;remote-ssh-edit&amp;quot;;&lt;br /&gt;
        publisher = &amp;quot;ms-vscode-remote&amp;quot;;&lt;br /&gt;
        version = &amp;quot;0.47.2&amp;quot;;&lt;br /&gt;
        sha256 = &amp;quot;1hp6gjh4xp2m1xlm1jsdzxw9d8frkiidhph6nvl24d0h8z34w49g&amp;quot;;&lt;br /&gt;
      }&lt;br /&gt;
    ];&lt;br /&gt;
  })&lt;br /&gt;
];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some examples here: [https://github.com/search?type=code&amp;amp;q=language:Nix+&amp;amp;#x22;extensionFromVscodeMarketplace&amp;amp;#x22; GitHub Search - type:code language:Nix &amp;quot;extensionFromVscodeMarketplace&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
{{Note|For fetching the sha256 string you can use [https://nix.dev/manual/nix/stable/command-ref/new-cli/nix3-store-prefetch-file &amp;lt;code&amp;gt;nix store prefetch-file&amp;lt;/code&amp;gt;] like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;nix store prefetch-file marketplace.visualstudio.com/_apis/public/gallery/publishers/&amp;lt;publisher&amp;gt;/vsextensions/&amp;lt;extension&amp;gt;/&amp;lt;version&amp;gt;/vspackage&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;nix store prefetch-file https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-vscode-remote/vsextensions/remote-ssh-edit/0.47.2/vspackage&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;extensionsFromVscodeMarketplace&amp;lt;/code&amp;gt; is a manual way to fetch extensions. However, to keep updated from upstream, [https://github.com/nix-community/nix-vscode-extensions nix-community/nix-vscode-extensions] provides the Nix expressions for the majority of available extensions from Open VSX and VSCode Marketplace. A GitHub Action updates the extensions daily. Similarly, [https://github.com/nix-community/nix4vscode nix-community/nix4vscode] provides a Nix overlay for VSCode Marketplace and Open VSX extensions.&lt;br /&gt;
&lt;br /&gt;
=== Home Manager ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nix&amp;quot;&amp;gt;programs.vscode = {&lt;br /&gt;
  enable = true;&lt;br /&gt;
  profiles.default.extensions = with pkgs.vscode-extensions; [&lt;br /&gt;
    dracula-theme.theme-dracula&lt;br /&gt;
    vscodevim.vim&lt;br /&gt;
    yzhang.markdown-all-in-one&lt;br /&gt;
  ];&lt;br /&gt;
};&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* See for more options: [https://nix-community.github.io/home-manager/options.xhtml#opt-programs.vscode.enable Home Manager Manual: Options - programs.vscode]&lt;br /&gt;
* Search for extensions with configurations: [https://search.nixos.org/packages?type=packages&amp;amp;query=vscode-extensions NixOS Search: vscode-extensions]&lt;br /&gt;
&lt;br /&gt;
=== Nix-env ===&lt;br /&gt;
{{Warning|Use of nix-env is unreproducible and thus discouraged and not recommended}}&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;nix-env -iA nixos.vscode&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use VS Code extensions without additional configuration ==&lt;br /&gt;
With {{Nixpkg|pkgs/applications/editors/vscode/generic.nix|vscode.fhs}}, the editor launches inside a [[wikipedia:Filesystem_Hierarchy_Standard|FHS]] compliant chroot environment using {{Manual|nixpkgs|sec-fhs-environments|&amp;lt;code&amp;gt;buildFHSEnv&amp;lt;/code&amp;gt;}}. This reintroduces directories such as &amp;lt;code&amp;gt;/bin&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/lib&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;/usr&amp;lt;/code&amp;gt;, which allows for extensions which ship pre-compiled binaries to work with little to no additional nixification.&lt;br /&gt;
&lt;br /&gt;
{{note|{{Manual|nixpkgs|sec-fhs-environments|&amp;lt;code&amp;gt;buildFHSEnv&amp;lt;/code&amp;gt;}} allows for ease-of-use at the cost of impurity, non-reproducibility, and denied root access (you cannot use &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;.fhs&amp;lt;/code&amp;gt; packages, also see [https://discourse.nixos.org/t/sudo-does-not-work-from-within-vscode-fhs/14227])}}&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&amp;lt;syntaxHighlight lang=nix&amp;gt;&lt;br /&gt;
environment.systemPackages = with pkgs; [ vscode.fhs ];&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Home Manager ===&lt;br /&gt;
&amp;lt;syntaxHighlight lang=nix&amp;gt;&lt;br /&gt;
programs.vscode = {&lt;br /&gt;
  enable = true;&lt;br /&gt;
  package = pkgs.vscode.fhs;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adding extension-specific dependencies, these will be added to the FHS environment:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nix&amp;quot;&amp;gt;&lt;br /&gt;
# needed for rust lang server and rust-analyzer extension&lt;br /&gt;
programs.vscode.package = pkgs.vscode.fhsWithPackages (&lt;br /&gt;
  ps: with ps; [&lt;br /&gt;
    rustup&lt;br /&gt;
    zlib&lt;br /&gt;
    openssl.dev&lt;br /&gt;
    pkg-config&lt;br /&gt;
  ]&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Insiders Build ==&lt;br /&gt;
If you need to test a recent code change, you can run the insiders build. It is designed to run alongside the main build, with a separate &amp;lt;code&amp;gt;code-insiders&amp;lt;/code&amp;gt; command and a different config path, so you can leave your main VS Code instance installed/running.&lt;br /&gt;
&lt;br /&gt;
The following derivation builds a package with the latest insiders build (on NixOS in &amp;lt;code&amp;gt;environment.systemPackages&amp;lt;/code&amp;gt;, or on Home Manager in &amp;lt;code&amp;gt;home.packages&amp;lt;/code&amp;gt;) :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=nix&amp;gt;&lt;br /&gt;
(pkgs.vscode.override { isInsiders = true; }).overrideAttrs (oldAttrs: rec {&lt;br /&gt;
  src = (builtins.fetchTarball {&lt;br /&gt;
    url = &amp;quot;https://code.visualstudio.com/sha/download?build=insider&amp;amp;os=linux-x64&amp;quot;;&lt;br /&gt;
    sha256 = &amp;quot;AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&amp;quot;;&lt;br /&gt;
  });&lt;br /&gt;
  version = &amp;quot;latest&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  buildInputs = oldAttrs.buildInputs ++ [ pkgs.krb5 ];&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;[https://discourse.nixos.org/t/how-to-install-latest-vscode-insiders/7895/4 credits: @jnoortheen]&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
=== Updating insiders placeholder &amp;lt;code&amp;gt;sha256&amp;lt;/code&amp;gt; ===&lt;br /&gt;
You will need to update the placeholder &amp;lt;code&amp;gt;sha256&amp;lt;/code&amp;gt; value for each new Insiders build.&lt;br /&gt;
&lt;br /&gt;
The new value will appear in a validation error when you try to build.&lt;br /&gt;
&lt;br /&gt;
Put an arbitrary placeholder value in the &amp;lt;code&amp;gt;sha256&amp;lt;/code&amp;gt; field, try to build and you&amp;#039;ll get an error message regarding the sha256 value.&lt;br /&gt;
&lt;br /&gt;
=== Resolving the &amp;quot;hash mismatch&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
==== For &amp;lt;code&amp;gt;sha256:&amp;lt;/code&amp;gt; ====&lt;br /&gt;
Example:&amp;lt;pre&amp;gt;//-- ...&lt;br /&gt;
       error: hash mismatch in file downloaded from &amp;#039;https://code.visualstudio.com/sha/download?build=insider&amp;amp;os=linux-x64&amp;#039;:&lt;br /&gt;
         specified: sha256:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&lt;br /&gt;
         got:       sha256:16fzxqs6ql4p2apq9aw7l10h4ag1r7jwlfvknk5rd2zmkscwhn6z&lt;br /&gt;
//-- ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the &amp;quot;got&amp;quot; value (while stripping out the prepended &amp;quot;&amp;lt;code&amp;gt;sha256:&amp;lt;/code&amp;gt;&amp;quot;), and paste it in your placeholder &amp;lt;code&amp;gt;sha256&amp;lt;/code&amp;gt; value&lt;br /&gt;
&lt;br /&gt;
Resulting: &amp;quot;&amp;lt;code&amp;gt;16fzxqs6ql4p2apq9aw7l10h4ag1r7jwlfvknk5rd2zmkscwhn6z&amp;lt;/code&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===== For &amp;lt;code&amp;gt;sha256-&amp;lt;/code&amp;gt;  =====&lt;br /&gt;
Example:&amp;lt;pre&amp;gt;//-- ...&lt;br /&gt;
        error: hash mismatch in fixed-output derivation &amp;#039;/nix/store/path&amp;#039;:&lt;br /&gt;
         specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=&lt;br /&gt;
            got:    sha256-aQvTtZdPU2F1UjkFxiLs4A+60A4qc9bXKwKriNsCDPg=&lt;br /&gt;
//-- ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the &amp;quot;got&amp;quot; value (while stripping out the prepended &amp;quot;&amp;lt;code&amp;gt;sha256-&amp;lt;/code&amp;gt;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Then, run the following python script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import base64&lt;br /&gt;
text = b&amp;#039;aQvTtZdPU2F1UjkFxiLs4A+60A4qc9bXKwKriNsCDPg=&amp;#039; # Replace the string in between &amp;#039; with the according hash&lt;br /&gt;
print(base64.decodebytes(text).hex())&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Its output should be pasted in your placeholder &amp;lt;code&amp;gt;sha256&amp;lt;/code&amp;gt; value&lt;br /&gt;
&lt;br /&gt;
== Creating development environments using nix-shell ==&lt;br /&gt;
Instead of using configuration.nix to add packages (e.g. Python or NodeJS) for developing code on VSCode, you can instead use nix-shell. This will allow you to seamlessly create development environments with the correct packages for your project, without rebuilding and restarting NixOS. See [[Development_environment_with_nix-shell | this page]] for further instructions in building nix-shell development environments.&lt;br /&gt;
&lt;br /&gt;
=== Automatically switch nix shells when switching projects ===&lt;br /&gt;
You can do this by using [https://github.com/nix-community/nix-direnv nix-direnv] and [https://marketplace.visualstudio.com/items?itemName=mkhl.direnv the VSCode extension direnv] for integration. View the nix-direnv github page linked for a guide on setting it up.&lt;br /&gt;
&lt;br /&gt;
=== Alternative for manually switching shells ===&lt;br /&gt;
The extension [https://marketplace.visualstudio.com/items?itemName=arrterian.nix-env-selector nix-env-selector] will make switching between different nix-shell environments within VSCode so you can switch between different coding projects easily and manually. It has a guide for setting up nix-shell environments for VSCode.&lt;br /&gt;
&lt;br /&gt;
== Wayland ==&lt;br /&gt;
&lt;br /&gt;
To make sure VSCode runs on Wayland native instead of Xwayland, you can make it use Ozone Wayland by setting the environment variable &amp;lt;code&amp;gt;NIXOS_OZONE_WL&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;NIXOS_OZONE_WL=1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Wayland#Electron and Chromium]]&lt;br /&gt;
&lt;br /&gt;
== Updating extension versions ==&lt;br /&gt;
&lt;br /&gt;
The Nixpkgs vscode extensions directory contains [https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vscode/extensions/update_installed_exts.sh a script] which use &amp;lt;code&amp;gt;code --list-extensions&amp;lt;/code&amp;gt; and lookup the latest versions of those extensions to outputs a nix expression with a single &amp;lt;code&amp;gt;extensions&amp;lt;/code&amp;gt; attribute of the same type as &amp;lt;code&amp;gt;extensionsFromVscodeMarketplace&amp;lt;/code&amp;gt; inputs.&lt;br /&gt;
&lt;br /&gt;
To run it in your current directory:&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;curl -fsSL https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/applications/editors/vscode/extensions/update_installed_exts.sh | sh&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example output ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;curl -fsSL https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/applications/editors/vscode/extensions/update_installed_exts.sh | sh&lt;br /&gt;
{ extensions = [&lt;br /&gt;
  {&lt;br /&gt;
    name = &amp;quot;project-manager&amp;quot;;&lt;br /&gt;
    publisher = &amp;quot;alefragnani&amp;quot;;&lt;br /&gt;
    version = &amp;quot;12.4.0&amp;quot;;&lt;br /&gt;
    sha256 = &amp;quot;0q6zkz7pqz2prmr01h17h9a5q6cn6bjgcxggy69c84j8h2w905wy&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  {&lt;br /&gt;
    name = &amp;quot;githistory&amp;quot;;&lt;br /&gt;
    publisher = &amp;quot;donjayamanne&amp;quot;;&lt;br /&gt;
    version = &amp;quot;0.6.18&amp;quot;;&lt;br /&gt;
    sha256 = &amp;quot;01lc9gpqdjy6himn7jsfjrfz8xrk728c20903lxkxy5fliv232gz&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
];&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Remote SSH ==&lt;br /&gt;
&lt;br /&gt;
The remote-ssh extension works by connecting to a remote host and downloading scripts and pre-built binaries to {{ic|$HOME/.vscode-server}}. When first launching remote-ssh for a NixOS host, the connection will fail due to the provided node.js not having been built for a NixOS system (the dynamic libraries aren&amp;#039;t in the same place).&lt;br /&gt;
&lt;br /&gt;
=== Any client to NixOS host ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;tl;dr Use [https://github.com/msteen/nixos-vscode-server nix-vscode-server] or [https://github.com/Mic92/nix-ld nix-ld] on host machines.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== nix-vscode-server ====&lt;br /&gt;
&lt;br /&gt;
Note that nix-vscode-server works as of 8/21/21 but is occasionally broken (See https://github.com/msteen/nixos-vscode-server/pull/3, https://github.com/msteen/nixos-vscode-server/pull/4, https://github.com/msteen/nixos-vscode-server/pull/5). Here&amp;#039;s a workaround: Install the &amp;lt;code&amp;gt;nodejs-16_x&amp;lt;/code&amp;gt; package on the NixOS host, and then run the following nix-shell script:&lt;br /&gt;
&amp;lt;syntaxHighlight lang=haskell&amp;gt;&lt;br /&gt;
#! /usr/bin/env nix-shell&lt;br /&gt;
#! nix-shell --pure -i runghc -p &amp;quot;haskellPackages.ghcWithPackages (pkgs: [ pkgs.turtle ])&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{-# LANGUAGE OverloadedStrings #-}&lt;br /&gt;
import Turtle&lt;br /&gt;
&lt;br /&gt;
main = sh $ do&lt;br /&gt;
  homedir &amp;lt;- home&lt;br /&gt;
  subdir &amp;lt;- ls $ homedir &amp;lt;/&amp;gt; &amp;quot;.vscode-server/bin/&amp;quot;&lt;br /&gt;
  let nodepath = subdir &amp;lt;/&amp;gt; &amp;quot;node&amp;quot;&lt;br /&gt;
  badnode &amp;lt;- isNotSymbolicLink nodepath&lt;br /&gt;
  if badnode&lt;br /&gt;
    then do&lt;br /&gt;
      mv nodepath (subdir &amp;lt;/&amp;gt; &amp;quot;node_backup&amp;quot;)&lt;br /&gt;
      symlink &amp;quot;/run/current-system/sw/bin/node&amp;quot; nodepath&lt;br /&gt;
      echo (&amp;quot;Fixed &amp;quot; &amp;lt;&amp;gt; repr subdir)&lt;br /&gt;
    else do&lt;br /&gt;
      echo (&amp;quot;Already fixed &amp;quot; &amp;lt;&amp;gt; repr subdir)&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If instead you&amp;#039;d prefer to fix the binaries manually and have to do so every time that you upgrade your VS Code version, then you can install the &amp;lt;code&amp;gt;nodejs-16_x&amp;lt;/code&amp;gt; package on the NixOS host and replace the VS Code provided version. This workaround is described here: https://github.com/microsoft/vscode-remote-release/issues/648#issuecomment-503148523. Note that NodeJS needs to be updated according to VS Code upstream requirements (NodeJS 16 required from 4/2022).&lt;br /&gt;
&lt;br /&gt;
==== nix-ld ====&lt;br /&gt;
&lt;br /&gt;
Add the following settings to &amp;lt;code&amp;gt;configuration.nix&amp;lt;/code&amp;gt; on the NixOS host&lt;br /&gt;
&lt;br /&gt;
{{file|/etc/nixos/configuration.nix|nix|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
  programs.nix-ld.enable = true;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt;nixos-rebuild switch&amp;lt;/code&amp;gt; to enable &amp;lt;code&amp;gt;nix-ld&amp;lt;/code&amp;gt;. Unlike the &amp;lt;code&amp;gt;nix-vscode-server&amp;lt;/code&amp;gt; solution, the &amp;lt;code&amp;gt;nix-ld&amp;lt;/code&amp;gt; solution also enables VSCode extensions even if they include non-Nix binaries.&lt;br /&gt;
&lt;br /&gt;
=== Nix-sourced VS Code to NixOS host ===&lt;br /&gt;
&lt;br /&gt;
If vscode-remote is installed from nix (vscode-extensions.ms-vscode-remote as above) on the client machine, everything should &amp;quot;just work&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Remote WSL ==&lt;br /&gt;
&lt;br /&gt;
Similar to SSH hosts, both &amp;lt;code&amp;gt;nix-vscode-server&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;nix-ld&amp;lt;/code&amp;gt; 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 &amp;lt;code&amp;gt;wsl.exe --exec&amp;lt;/code&amp;gt; to start the code server, which bypasses NixOS environment variables required by &amp;lt;code&amp;gt;nix-ld&amp;lt;/code&amp;gt;, resulting in failures. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As a workaround, search for the following text in all files under the directory &amp;lt;code&amp;gt;$HOME\.vscode\extensions\&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{file|wslDaemon.js|js|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
.push(&amp;quot;sh&amp;quot;,&amp;quot;-c&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Replace it with&lt;br /&gt;
&lt;br /&gt;
{{file|wslDaemon.js|js|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
.push(&amp;quot;sh&amp;quot;,&amp;quot;-l&amp;quot;,&amp;quot;-c&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Then restart VS Code and your VS Code client should be able to connect to NixOS host&lt;br /&gt;
&lt;br /&gt;
See https://github.com/nix-community/NixOS-WSL/issues/222 for the discussion about &amp;lt;code&amp;gt;wsl --exec&amp;lt;/code&amp;gt; issue on NixOS-WSL.&lt;br /&gt;
See https://github.com/microsoft/vscode-remote-release/issues/8305#issuecomment-1661396267 about the workaround.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Writing login information to the keychain failed ===&lt;br /&gt;
&lt;br /&gt;
If you get an error similar to the following, enable a [[Secret Service]] provider.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Writing login information to the keychain failed with error &amp;#039;The name org.freedesktop.secret was not provided by any .service files&amp;#039;.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Server did not start successfully ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Server did not start successfully. Full server log at /home/user/.vscode-server/.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.log&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
server log:&amp;lt;br&amp;gt;&lt;br /&gt;
/home/user/.vscode-server/bin/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/bin/code-server: line 12: /home/user/.vscode-server/bin/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/node: No such file or directory&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;No such file or directory&amp;quot; means that libc is not found, see&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ldd ~/.vscode-server/bin/*/node&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
try to run the node binary on the server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
~/.vscode-server/bin/*/node&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if this fails, install node version 16, and try to patch the node binary&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nix-env -iA nixos.nodejs-16_x&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=bash&amp;gt;&lt;br /&gt;
#! /bin/sh&lt;br /&gt;
# fix-vscode-server-node.sh&lt;br /&gt;
# https://github.com/microsoft/vscode-remote-release/issues/648#issuecomment-503148523&lt;br /&gt;
cd ~/.vscode-server/bin/*&lt;br /&gt;
if ! ./node -e &amp;quot;require(&amp;#039;process&amp;#039;).exit(0)&amp;quot;&lt;br /&gt;
then&lt;br /&gt;
  echo patching node binary $(readlink -f node)&lt;br /&gt;
  rm node&lt;br /&gt;
  ln -s $(which node)&lt;br /&gt;
else&lt;br /&gt;
  echo node is working $(readlink -f node)&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Timeout ===&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re using fish or other shell, set this in the user settings JSON on the client machine:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxHighlight lang=bash&amp;gt;&lt;br /&gt;
&amp;quot;remote.SSH.useLocalServer&amp;quot;: false&lt;br /&gt;
&amp;lt;/syntaxHighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See https://github.com/microsoft/vscode-remote-release/issues/2509 and https://github.com/nix-community/nixos-vscode-server/issues/18&lt;br /&gt;
&lt;br /&gt;
[[Category:Applications]]&lt;br /&gt;
&lt;br /&gt;
[[Category:IDE]]&lt;/div&gt;</summary>
		<author><name>FuzzyBot</name></author>
	</entry>
</feed>