add scripts for vscode server

This commit is contained in:
mjallen18
2024-02-23 17:13:33 -06:00
parent 93fa165ba9
commit dc6ebf3cbb
3 changed files with 71 additions and 15 deletions

18
scripts/nix-vscode-server Executable file
View File

@@ -0,0 +1,18 @@
#! /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)