Skip to content

docs: add tutorial for overriding package versions#447

Open
djsauble wants to merge 2 commits intomainfrom
tutorial/overriding-packages
Open

docs: add tutorial for overriding package versions#447
djsauble wants to merge 2 commits intomainfrom
tutorial/overriding-packages

Conversation

@djsauble
Copy link
Contributor

@djsauble djsauble commented Mar 17, 2026

Preview: https://7b3090989ba86e5ccb0be2917ee4f84f5544bdfa--floxdocs.netlify.app/docs/tutorials/overriding-packages/

  • Adds a new tutorial (docs/tutorials/overriding-packages.md) walking through the end-to-end workflow of using overrideAttrs to get a newer version of a package before it's available in the Flox Catalog
  • Covers writing the Nix expression, the empty-hash trick, building, publishing, and installing from another environment
  • Adds nav entry in mkdocs.yml after "Building and publishing packages"

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Mar 17, 2026
@djsauble djsauble self-assigned this Mar 17, 2026
@djsauble djsauble marked this pull request as ready for review March 17, 2026 18:22
@djsauble djsauble requested review from jbayer and ysndr March 17, 2026 18:23
Walk through the end-to-end workflow of using overrideAttrs to
get a newer version of a package before it's available in the
Flox Catalog — from writing the Nix expression through building,
publishing, and installing the override.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@djsauble djsauble force-pushed the tutorial/overriding-packages branch from a6df6d8 to 9b6bcb6 Compare March 17, 2026 18:25
@github-actions
Copy link

@github-actions
Copy link

Copy link
Contributor

@ysndr ysndr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be continued

Comment on lines +10 to +12
The Flox Catalog tracks [nixpkgs][nixpkgs], which means there can be a
short delay between an upstream release and its availability in
the catalog.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should link to the stabilities doc page here because it's not obvious what "tracking nixpkgs" means in practice (which branch, channel, cadence)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a link to the Base Catalog page right after the nixpkgs mention.

Comment on lines +24 to +25
Rather than waiting for the catalog to catch up, you'll
override the package to use the newer release.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wording, I'd like to avoid saying overriding a package.
My understanding of packages is that those are the final built artifacts. At this point we would be talking about overriding the recipe producing the package. (Or possibly more orecisely we create a new recipe from an existing one but tha might be splitting hairs.$

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call — reworded throughout to say "build recipe" instead of "package" when referring to what gets overridden.

Let's set that up and publish:

```text
$ git remote add origin "$PWD"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd consider this a huge anti pattern for our own good.

Copy link
Contributor Author

@djsauble djsauble Mar 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to keep the tutorial as self-contained as possible, which is why I'm not walking people through the process of creating a GitHub repository and adding it as a remote.

But we could add a note above this section (and maybe a comment inline as well) calling this out as an anti-pattern and telling people what they should do instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a warning admonition before the code block calling out the $PWD remote as a simplification, and removed the softer note that was after it.

- Link to Base Catalog page for context on nixpkgs tracking (ysndr)
- Reword "override the package" to "override the build recipe" (ysndr)
- Add note about attribute differences across packages (jbayer)
- Move $PWD anti-pattern warning before the code block (ysndr)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link

@djsauble djsauble requested a review from ysndr March 18, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants