Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions concepts/publishing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,16 @@ A published package consists of two parts:
- The package itself

The package metadata is uploaded to Flox servers so that the Flox CLI can see that it's available via the [`flox search`](/man/flox-search), [`flox show`](/man/flox-show), and [`flox install`](/man/flox-install) commands.
The package itself is uploaded to a Catalog Store.
The package itself goes to the catalog's Catalog Store, which is effectively a binary cache for published packages.

A Catalog Store is effectively a cache for published packages, and Flox provides one by default.
An organization can choose to provide their own Catalog Store in the form of an S3-compatible storage provider.
In this case, it means that your organization has complete control over your packages and they will never be stored by Flox.
To pursue this option, contact Flox directly.
Each catalog uses one of three kinds of Catalog Store:

- **Flox-hosted** (default): Flox signs and hosts the package binaries.
- **Your own binary cache**: `flox publish` signs the binaries with your key and copies them to an S3-compatible bucket you provide. Flox never stores the binaries, and installs need credentials for your cache.
- **Metadata only**: Flox stores only the metadata and no binaries are uploaded. Installs only work if the binaries are already in the local Nix store or a configured substituter.

See [Catalog stores](/customer/catalog-store) for details on each option.
To use your own binary cache or a metadata-only store, contact Flox directly.

## Consuming published packages

Expand All @@ -63,7 +67,8 @@ To distinguish these packages from those provided by the Base Catalog, published
For example, if your user is called `myuser` and you publish a package named `hello`, the package will appear as `myuser/hello` in the Flox CLI.

When a user runs `flox install myuser/hello`, the package is downloaded directly from the Catalog Store that it was published to.
If organizations configure their own Catalog Store (rather than using the default Catalog Store provided by Flox), it is never downloaded to or cached on Flox servers.
If your organization uses its own binary cache, the package is never downloaded to or cached on Flox servers.
If the catalog uses a metadata-only store, Flox doesn't download anything, so the package must already be available locally or from a configured substituter.

### Sharing

Expand Down
58 changes: 45 additions & 13 deletions customer/catalog-store.mdx
Original file line number Diff line number Diff line change
@@ -1,24 +1,54 @@
---
title: "Catalog Store"
description: "Create a Catalog Store for publishing your own Flox packages"
title: "Catalog stores"
description: "Choose where Flox stores the binaries for packages published to your catalog: on Flox, in your own binary cache, or metadata only"
---

Note that this page is only relevant if your organization has chosen to provide its own Catalog Store.
By default, Flox provides a pre-configured Catalog Store to each organization as part of the organization's private Catalog.
When you run `flox publish`, the package metadata always goes to Flox so that `flox search`, `flox show`, and `flox install` can find the package.
The package binaries go to the catalog's Catalog Store.
Flox supports three kinds of Catalog Store.
You choose one per catalog, and all three work with FloxHub.

| Catalog Store | Who stores the binaries | Who signs them | What installs need |
| --- | --- | --- | --- |
| [Flox-hosted](#flox-hosted-store) (default) | Flox | Flox | Nothing extra |
| [Your own binary cache](#your-own-binary-cache) | You, in an S3-compatible bucket | You, with your own key | Credentials for your cache and your public key |
| [Metadata only](#metadata-only-store) | Nobody | Not applicable | The binaries already in the local Nix store or a configured substituter |

To use your own binary cache or a metadata-only store, contact your Flox point of contact to configure the catalog.

## Flox-hosted store

By default, Flox provides a pre-configured Catalog Store as part of each catalog.
Flox signs the binaries you publish with the `floxhub-1` key and hosts them.
The Flox installer configures your system to trust `floxhub-1`, so installs work out of the box.
If you installed Flox with Nix instead, see [Signing keys](/customer/signing-keys) to trust the key.

## Metadata-only store

With a metadata-only store, `flox publish` sends only the package metadata to Flox and uploads no binaries.
The package still appears in `flox search`, `flox show`, and `flox install`.

`flox install` only succeeds when the package's binaries are already in your local Nix store or in one of the substituters in your Nix configuration.
Flox doesn't fall back to building the package from source.

## Your own binary cache

With your own binary cache, your organization keeps complete control over the package binaries, and Flox never stores them.
`flox publish` signs the binaries with your private key and copies them to your cache.
Flox stores the package metadata, including where to download the binaries from.
`flox install` downloads the binaries directly from your cache, so anyone installing the package needs credentials for the cache and must trust your public key.

A user-provided Catalog Store is an AWS S3 bucket
or any S3 compatible service, like [MinIO](https://min.io/product/s3-compatibility)
or [Backblaze B2](https://www.backblaze.com/cloud-storage). (For the
sake of simplicity, this guide focuses on S3, but there are other providers
available if you prefer them to AWS.)

To configure your Catalog to use this Catalog Store, you will need to set ingress (where new packages are uploaded to) and egress (where packages are downloaded from) URIs for the Catalog.
This is done with a command line utility provided by Flox.
To configure your catalog to use this Catalog Store, Flox sets ingress (where new packages are uploaded to) and egress (where packages are downloaded from) URIs for the catalog.

### Configure an AWS S3 bucket

## Configure an AWS S3 bucket

The first step in setting up your Catalog Store is creation and configuration of
The first step in setting up your own binary cache is creation and configuration of
an AWS S3 Bucket. There are numerous ways to accomplish this, including the AWS
Console, the AWS CLI, and Terraform (or another infrastructure-as-code tool),
to name a few. These processes are well documented, but to get started,
Expand All @@ -35,7 +65,7 @@ the setup process. Simply reach out to your designated point of contact,
and we'll work with you to get you up and running.


### Policy example
#### Policy example

By default, S3 buckets are normally confined to be read by the bucket owner or users within the same AWS account. This is likely a decent starting point for the Catalog Store. However, if you'd like to make your published Flox software available to a wider audience, you can use the following policy as a starting point. Note this will make the contents of the bucket public, so be sure to understand the implications of this before applying it.

Expand All @@ -54,7 +84,7 @@ By default, S3 buckets are normally confined to be read by the bucket owner or u
}
```

## Ensure the Nix Daemon has access to the S3 Bucket
### Ensure the Nix daemon has access to the S3 bucket

As you probably know by now, the underlying technology powering Flox is Nix.
Accordingly, we need to take a couple steps to ensure that the Nix daemon
Expand All @@ -64,12 +94,14 @@ Use the `aws configure` or `aws configure sso` command [as described in the CLI

You can confirm that everything is set up correctly by inspecting the values stored in `$HOME/.aws/credentials`.

Every machine that publishes to or installs from this catalog needs credentials with access to the bucket.


## Set Catalog Store ingress and egress URIs
### Set Catalog Store ingress and egress URIs

Reach out to your Flox point of contact to accomplish this step.

## Create and set a signing key
### Create and set a signing key

At this point, you should have an appropriately configured Catalog Store
to which you can publish your own software via the `flox publish` command.
Expand Down
2 changes: 1 addition & 1 deletion customer/signing-keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ nix.settings.extra-trusted-public-keys = [

See the [generic Nix install instructions](/install-flox/install#generic-nix) for the full configuration examples, including the Flox binary cache key.

However, if you're providing your own Catalog Store, then you must
However, if your catalog uses [your own binary cache](/customer/catalog-store#your-own-binary-cache) as its Catalog Store, then you must

- Create the signing keys
- Distribute the private key to users trusted to publish packages
Expand Down
2 changes: 1 addition & 1 deletion llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Key terms:

## Enterprise and operations

- [Catalog Store](https://flox.dev/docs/customer/catalog-store.md): Create a Catalog Store for publishing your own Flox packages
- [Catalog stores](https://flox.dev/docs/customer/catalog-store.md): Choose where Flox stores the binaries for packages published to your catalog: on Flox, in your own binary cache, or metadata only
- [Known issues](https://flox.dev/docs/customer/known-issues.md): Known Flox limitations and their workarounds, including false-positive build dependencies
- [Signing keys](https://flox.dev/docs/customer/signing-keys.md): Create and use signing keys to sign built artifacts

Expand Down
2 changes: 1 addition & 1 deletion styles/config/vocabularies/Flox/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Nixpkgs
_oldAttrs
oldAttrs
sourceRoot
substituters
substituters?
vendorHash

# === AI agents ===
Expand Down
Loading