Skip to content

Commit

Permalink
Merge pull request #113 from cachix/importing
Browse files Browse the repository at this point in the history
add importing from S3 documentation
  • Loading branch information
domenkozar authored Dec 6, 2023
2 parents 6e74349 + 53f287f commit 06df3e2
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ If the entry exists:
2. If you ran ``nix-build`` before binary cache has been populated,
Nix will maintain a negative cache for the entry.

`See a workaround to remove negative caching <https://nix.dev/recipes/faq.html#how-do-i-force-nix-to-re-check-whether-something-exists-at-a-binary-cache>`_.
`See a workaround to remove negative caching <https://nix.dev/guides/faq.html#how-do-i-force-nix-to-re-check-whether-something-exists-at-a-binary-cache>`_.

3. Substitution could be disabled for that derivation via ``allowSubstitutes = false;`` attribute.

Expand Down
2 changes: 2 additions & 0 deletions source/getting-started.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _getting-started:

Getting Started
===============

Expand Down
64 changes: 64 additions & 0 deletions source/importing-from-s3.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
Importing from S3
=================

.. versionadded:: 1.7

Overview
--------

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.

Prerequisites
-------------

- **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.

Importing Cache from S3
-----------------------

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

Step 1: Configure AWS Credentials
*********************************

Before proceeding, configure your AWS credentials:

::

$ aws configure


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

Step 2: Cachix Installation
**********************************

For installation instructions and verification, refer to the :ref:`Cachix getting started guide <getting-started>`.


Step 3: Start the Import Process
********************************

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

Syntax::

$ cachix import <cache-name> s3://<bucket-name>


Example::

$ cachix import mycache s3://mybucket


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

Important Notes
---------------

- 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.
1 change: 1 addition & 0 deletions source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Topics
installation.rst
getting-started.rst
continuous-integration-setup/index.rst
importing-from-s3.rst
deploy/index.rst
pushing.rst
garbage-collection.rst
Expand Down
2 changes: 1 addition & 1 deletion source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Installation
Recommended
-----------

With `Nix installed <https://nix.dev/tutorials/install-nix.html>`_::
With `Nix installed <https://nix.dev/install-nix>`_::

$ nix-env -iA cachix -f https://cachix.org/api/v1/install

Expand Down

0 comments on commit 06df3e2

Please sign in to comment.