#!/bin/sh # the workerd npm downloads asks for a generic linux loader that nixos doesn't ship # only the nix app sets TNGL_DYNAMIC_LINKER, so everywhere else this is a no-op set -eu [ -n "${TNGL_DYNAMIC_LINKER:-}" ] || exit 0 for bin in "$1"/node_modules/.pnpm/@cloudflare+workerd-linux-*/node_modules/@cloudflare/workerd-linux-*/bin/workerd; do [ -f "$bin" ] || continue patchelf --set-interpreter "$TNGL_DYNAMIC_LINKER" --set-rpath "$TNGL_NIX_LIBS" "$bin" done