The Flox Catalog tracks nixpkgs, which means there can be a short delay between an upstream release and its availability in the catalog. See What is the Base Catalog? for details on how the catalog tracks nixpkgs and how often it updates. If you need a newer version right away, you can override the existing build recipe to point at the new release, then build and publish it so the updated version is available everywhere. This tutorial walks through the full workflow using Nix expression builds.Documentation Index
Fetch the complete documentation index at: https://flox.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
Scenario
Imagine the Flox Catalog currently provideshello version
2.12.1, but you need version 2.12.2.
Rather than waiting for the catalog to catch up, you’ll
override the build recipe to use the newer release.
Create an environment
Let’s start by creating a fresh environment for our override:Write the override
Create a Nix expression that takes the existinghello build
recipe and overrides its version and src attributes:
The attributes you need to override depend on how the
package is defined in nixpkgs. Different packages may use
different attribute names or build patterns. Check the
nixpkgs source for the package you’re modifying.
.flox/pkgs/hello/default.nix
The
hash is set to an empty string because we don’t know
the correct value yet. We’ll let the build tell us in the
next step.Set up Git
Nix expression builds require that all files in.flox/pkgs/
are tracked by Git.
Let’s initialize a repository and add our files:
Get the correct hash
Runflox build and it will fail with the expected hash:
got: line and paste it into your
expression:
.flox/pkgs/hello/default.nix
Build the package
Now runflox build again:
Publish the package
Theflox publish command requires a remote and
all tracked files committed and pushed.
Let’s set that up and publish:
flox publish command performs a clean build from a
temporary checkout to ensure the package is fully reproducible.
See the publishing concept page for more
details.
Install from another environment
Once published, the overridden package is available in any Flox environment. Let’s create a new environment and install it there:Next steps
This tutorial covered the simplest override — bumping a version number. The Nix expression builds concept page covers additional patterns:- Adding extensions to an existing package
- Applying patches to fix bugs
- Vendoring a package for deeper modifications