This required adding a new environment variable NIX_LDFLAGS_AFTER that ensures that the -L.../usr/lib flag happens last.