Skip to content
Cachix

Importing from S3

Added in version 1.7.

When transitioning to Cachix, it’s common practice to migrate your existing binary caches.

This document outlines the procedure for importing a binary cache from an Amazon S3 bucket into Cachix.

This migration process is beneficial for managing garbage collection, implementing enhanced authentication schemes, and consolidating multiple binary caches.

  • AWS CLI: The AWS Command Line Interface should be installed and configured on your system.
  • Cachix: Ensure that Cachix is installed. For instructions on installing Cachix, refer to the Getting Started with Cachix guide.

The following steps outline the process of importing a binary cache from an S3 bucket:

Before proceeding, configure your AWS credentials:

Terminal window
$ aws configure

Follow the prompts to input your AWS Access Key ID, Secret Access Key, and default region.

For installation instructions and verification, refer to the Cachix getting started guide.

To import the binary cache from your S3 bucket to Cachix, use the following command:

Syntax:

Terminal window
$ cachix import <cache-name> s3://<bucket-name>?endpoint=<uri>&region=<region>

Example:

Terminal window
$ cachix import mycache s3://mybucket

Replace <cache-name> with your Cachix cache name and <bucket-name> with your S3 bucket name.

  • Data Streaming: All contents of the cache will be streamed through the machine executing the command. It is recommended to perform this operation on a machine with a fast network connection.