tests: Add 'with-derivation-substitute' and use it.