install_name_tool -change libfoo @executable_path/../libs/libfoo
does precisely that. @executable_path is evaluated at runtime.
does precisely that. @executable_path is evaluated at runtime.
Since nix stores everything at /nix/store, I didn't want to mess with relative paths...
But yeah, macOS apps can ship their own version of libraries thanks to this flexibility.