Declaratively make /nix/store permissions 1771?

Does anyone have any good suggestions for ways to make /nix/store permissions 1771? I’ve already tested it manually and NixOS works fine with those permissions.
The reason I want to do this is so that /nix/store can be safely exposed in containers without leaking information about the host machine, since then unprivileged users can’t see what paths are in the store without communicating with the daemon or similar.