For things in nixpkgs, the files will be mirrored on the nix cache. For your own stuff you could set up your own cache or use a service like cachix. There is also a nix option to set up a generic mirror which looks up files by hash, but I'm not sure if it works with all the ways to fetch things: https://nixos.org/manual/nix/stable/command-ref/conf-file#co...