[Nix-dev] cache.nixos.org. mirror

Nikolay Amiantov ab at fmap.me
Mon Oct 24 16:21:02 CEST 2016


On 10/24/2016 12:55 PM, Eelco Dolstra wrote:
> You could try the underlying S3 bucket
(https://nix-cache.s3.amazonaws.com/),
> but that should generally be avoided because it's a bit more expensive
than
> CloudFront (and of course slower).

That probably would be a fail-safe solution, though I went with
searching for not yet blocked CloudFront hosts instead (should be easier
on the server, too).

> BTW, currently the cache.nixos.org CloudFront distribution only uses US,
> Canadian and EU edge locations for cost reasons (e.g. the South
American edge
> locations are 3 times as expensive). However, since CloudFront doesn't
have any
> Russian edge locations, this probably doesn't matter.

The problem is that Russian authorities, sadly, don't make a difference
now between actual servers and CDNs which distribute their content. So
adding more CloudFront servers won't help -- it's just a matter of time
before they are blocked because something illegal is distributed via
them, too.

> If somebody wants to set up a mirror, I'm happy to help with that.
With Nix
> master, it's pretty easy to mirror (parts of) cache.nixos.org. For
example, to
> mirror the current 16.09-small release:
>
>   $ nix copy -r --store https://cache.nixos.org/ --to
file:///tmp/my-mirror \
>      $(curl -L
https://nixos.org/channels/nixos-16.09-small/store-paths.xz | xz -d)

Can I just pack this into a cronjob? Is there something more effective
that I should know about?

-- 
Nikolay.


More information about the nix-dev mailing list