Mandatory access to the binary cache. Possible?

Hey everyone,

We have some packages that are required to the dev environment to operate, including some docker images built in Nix. sometimes, people loosing their access to private binary cache for random reasons, like connectivity, credentials are expired and like. Currently, Nix just ignores the caches that are not accessible and continue executing a build and eventually end up with building something that cannot be built on that machine, like I mentioned, docker images with custom Nix packages in it, that were built on Linux. So users see errors like:

error: a 'x86_64-linux' with features {} is required to build '/nix/store/4c9dpgcxj9szcdyhlnmdd8vqjlfivfpg-<package>.drv', but I am a 'aarch64-darwin' with features {benchmark, big-parallel, nixos-test}

I am wondering, is there a way to restrict Nix to explicitly fail in case if there is no access to binary cache obtained successfully? I haven’t found anything related to that in the Nix configuration.

Best,
Oleg