Overview
Catalog imports allow your Nix expression builds to depend on packages provided by external sources: FloxHub users and organizations that publish reusable packages. Packages are added to a catalog withflox publish. Catalog imports are how you consume those packages in a build.
Nix expression builds already support vendoring existing packages by copying their expressions into your .flox/pkgs/ directory. Catalog imports extend this model by allowing expression sharing through a central registry at the granularity of catalogs, which correspond to FloxHub user or organization namespaces. You access their packages through the catalogs argument in your expressions. This keeps your build inputs explicit.
Catalog imports are a feature of Nix expression builds specifically. They do not apply to manifest-based builds. You should be familiar with defining packages in .flox/pkgs/ before using catalog imports.
Catalogs
A catalog references packages published to FloxHub viaflox publish. The catalog name corresponds to the FloxHub user or organization that published them.
Your own catalog is always accessible after authenticating with flox auth login. Organization catalogs are accessible to all members of the organization. Cross-user catalog sharing is not yet available on public FloxHub. For now, catalog imports between users require Flox on-prem.
Using catalogs in expressions
You access imported packages through thecatalogs argument in your Nix expressions.
Access packages by catalog name and package name:
.flox/pkgs/demo.nix
catalogs argument can be combined with other arguments from nixpkgs:
.flox/pkgs/my-app.nix
Resolving and locking
Catalog references are resolved and locked automatically when you runflox build or flox publish. There is no declaration file to maintain and no separate lock step. Flox resolves each catalogs.<catalog>.<package> reference to the latest available sources for that package and its dependency closure.
Locking happens at build time and is not written to a lockfile in your project. Because of this, two runs of flox build can resolve to different inputs as catalogs advance, and the transitive dependencies of a locked package may differ between builds. flox build on its own is not guaranteed to use the exact same dependencies each time.
flox publish pins the inputs it used. A published build records its source, its nixpkgs revision, and its resolved dependency closure, so it can be rebuilt from the same inputs later.
To pick up newer versions of a package from a catalog, re-run flox build (or flox publish).
Examples
Example: FloxHub catalog
This example uses a package published to FloxHub by the organizationmy-org.
1. Write an expression that uses it:
.flox/pkgs/demo.nix
catalogs.my-org.my-package reference as part of the build.
Example: Combining catalogs with nixpkgs
A realistic expression might use both catalog imports and standard nixpkgs helpers:.flox/pkgs/my-tool.nix
rustPlatform and lib come from nixpkgs, as with any standard Nix expression build. The catalogs.my-org.crypto-utils dependency is resolved from the my-org catalog.