24.11 changed the way SDKs work on Darwin. The SDK used in the stdenv
can be overridden by adding the appropriate apple-sdk
package to buildInputs
. This is documented extensively in the manual in the Darwin section.
The announcement from last fall when these changes landed goes into detail about what changed as well as what the changes enable. (I think the Flutter situation probably still sucks, but someone motivated to do so should be able to fix it.)