Jump to content

Visual Studio Code: Difference between revisions

no edit summary
imported>Sternenseemann
(Fixed syntax of example module)
imported>Samuela
No edit summary
Line 57: Line 57:


'''tl;dr Use [https://github.com/msteen/nixos-vscode-server nix-vscode-server] on host machines.'''
'''tl;dr Use [https://github.com/msteen/nixos-vscode-server nix-vscode-server] on host machines.'''
Note that nix-vscode-server is currently broken as of 5/28/21 (PRs to fix are 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's a workaround: Install the <code>nodejs-14_x</code> package on the NixOS host, and then run the following nix-shell script:
<syntaxHighlight lang=haskell>
#! /usr/bin/env nix-shell
#! nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (pkgs: [ pkgs.turtle ])"
{-# LANGUAGE OverloadedStrings #-}
import Turtle
main = sh $ do
  homedir <- home
  subdir <- ls $ homedir </> ".vscode-server/bin/"
  let nodepath = subdir </> "node"
  badnode <- isNotSymbolicLink nodepath
  if badnode
    then do
      mv nodepath (subdir </> "node_backup")
      symlink "/run/current-system/sw/bin/node" nodepath
      echo ("Fixed " <> repr subdir)
    else do
      echo ("Already fixed " <> repr subdir)
</syntaxHighlight>


If instead you'd prefer to fix the binaries manually and have to do so every time that you upgrade your VSCode version, then you can install the <code>nodejs-14_x</code> package on the NixOS host and replace the VSCode 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 VSCode upstream requirements (nodejs 14 is needed as of 5/14/2021).
If instead you'd prefer to fix the binaries manually and have to do so every time that you upgrade your VSCode version, then you can install the <code>nodejs-14_x</code> package on the NixOS host and replace the VSCode 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 VSCode upstream requirements (nodejs 14 is needed as of 5/14/2021).
Anonymous user