There is currently no way to prevent this, see Copy local flakes to the store lazily · Issue #3121 · NixOS/nix · GitHub.