Skip to content

A simple tool for mirroring nix binary caches

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

dnaq/nix-mirror

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nix-mirror: a tool for mirroring nix binary caches

Background

It is possible to mirror a nix binary cache using the nix command line tool using a command sucn as:

xzcat store-paths.xz | nix copy --from https://cache.nixos.org --to file:///path/to/where/the/mirror/should/end/up

where store-paths.xz is a file containing the store-paths of all binaries in the cache, e.g. https://channels.nixos.org/nixos-unstable/store-paths.xz

However that command will use a lot of system resources since it will unpack all of the downloaded files and repack them before writing them to disk (if I have understood the reasons for the high cpu usage correctly).

Features

  • Parallel downloads
  • Atomic downloads
  • Sha256 verification of downloaded archives.

Building

With cargo

Make sure to have openssl and pkg-config installed and run cargo build. If using nix you can use the provided shell.nix which is only a symlink to default.nix to get the dependencies.

With nix

Run nix-build as usual.

Usage

  • nix-mirror --help to show application help
  • nix-mirror store-paths.xz ./mirror to download all the archives in store-paths.xz and their transitive dependencies to the directory ./mirror.

License

Licensed under either of

at your option.

About

A simple tool for mirroring nix binary caches

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published