Created
May 5, 2020 23:52
-
-
Save ivan/90e6a44870862bc2da0ba5d91d12ee66 to your computer and use it in GitHub Desktop.
Script to patch vscode-server and rust-analyzer to run on NixOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -eu -o pipefail | |
# Patch the vscode-server node binary to run on NixOS. | |
# | |
# If this ever stops working, we could instead replace node with a corresponding version from nixkgs. | |
for i in ~/.vscode-server/bin/*/node; do | |
interpreter=$(patchelf --print-interpreter /run/current-system/sw/bin/sh) | |
patchelf --set-interpreter "$interpreter" "$i" | |
stdcpp_rpath=$(patchelf --print-rpath /run/current-system/sw/bin/node | tr ':' '\n' | grep gcc-) | |
patchelf --set-rpath "$stdcpp_rpath" "$i" | |
done | |
# Patch the rust-analyzer binary to run on NixOS | |
# | |
# https://github.com/rust-analyzer/rust-analyzer/pull/4157#issuecomment-623784773 | |
patchelf --set-interpreter "$(patchelf --print-interpreter /run/current-system/sw/bin/sh)" ~/.vscode-server/data/User/globalStorage/matklad.rust-analyzer/rust-analyzer-linux |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment