Darwin: how to override darwin.stdenv to use the natively installed Xcode (everything, toolchain, frameworks)?

In relation to these issues I’ve concluded there’s got to be a better way than to hack into the PATH of the shellHook of a devShell to force the shell to use the native Xcode installed on a MacOS system, which is frought with many problems (as shown in the referenced post)

It must surely be possible to somehow pass the existing /Applications/Xcode.app to everything that is used in the darwin.stdenv (for all its impurity) or alternatively do the same referencing an Xcode that has been added to the nix store (making it pure)?

I’ve stumbled upon mentions of overrideSDK etc., but these techniques seem to be long obsolete and non-existing in modern nixpkgs but I haven’t found references how to use these to achieve my goal. (I now saw some such needed functions under stdenvAdapters, so it’s now only a documentation or understanding issue?)

So what is the way to achieve this?