diff --git a/README.md b/README.md index 487a35a..060c315 100644 --- a/README.md +++ b/README.md @@ -166,8 +166,9 @@ The goal of this project is to make VS Code server work with NixOS, anything mor ```nix { services.vscode-server.postPatch = '' - bin=$1 - bin_dir=${config.services.vscode-server.installPath}/bin/$bin + bin_dir=$1 + # $bin_dir (vscode 1.105.1) is something like + # ~/.vscode-server/cli/servers/Stable-7d842fb85a0275a4a8e4d7e040d2625abbf7f084/server # ... ''; } diff --git a/pkgs/auto-fix-vscode-server.nix b/pkgs/auto-fix-vscode-server.nix index cfb9e65..4d92821 100644 --- a/pkgs/auto-fix-vscode-server.nix +++ b/pkgs/auto-fix-vscode-server.nix @@ -109,12 +109,21 @@ while read -rd ''' elf; do patch_elf "$elf" done < <(find "$bin_dir" -type f -perm -100 -printf '%p\0') + + # Refer to https://github.com/NixOS/nixpkgs/issues/405528. + # For whatever reason, libssl is required but absent from DT_NEEDED. + vsce_sign_bin="$bin_dir/node_modules/@vscode/vsce-sign/bin/vsce-sign" + if [[ -f "$vsce_sign_bin" ]]; then + patchelf \ + --add-needed ${lib.getLib openssl}/lib/libssl.so \ + "$vsce_sign_bin" + fi ''} # Mark the bin directory as being fully patched. echo 1 > "$patched_file" - ${optionalString (postPatch != "") ''${writeShellScript "post-patchelf-vscode-server" postPatch} "$bin"''} + ${optionalString (postPatch != "") ''${writeShellScript "post-patchelf-vscode-server" postPatch} "$bin_dir"''} ''; };