Issue description
Occasionally we want to access attributes on derivations without actually building them. For instance, a Darwin-only derivation may want to share the same "src" attribute with a Linux-only derivation. Or we may want to determine what systems the platform builds on (see #21845).
This may not be very easy to implement. Assertions abort evaluation, so perhaps we need something, else like a setup hook error?