It's better layering to do everything in ld-wrapper. Also, use numeric comparisons for `relocatable`.
(( "${NIX_DEBUG:-0}" >= 1) ))
set -x