Skip to content

new tutorial on vendoring dependencies with flox build#461

Open
barstoolbluz wants to merge 5 commits intomainfrom
vendoring-dependencies-flox-build-tutorial
Open

new tutorial on vendoring dependencies with flox build#461
barstoolbluz wants to merge 5 commits intomainfrom
vendoring-dependencies-flox-build-tutorial

Conversation

@barstoolbluz
Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: barstoolbluz <steve@flox.dev>
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Apr 1, 2026
@djsauble djsauble self-requested a review April 2, 2026 17:31
@@ -0,0 +1,230 @@
---
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do you want to add this page to the table of contents?

    - Package Priority: concepts/priority.md

Comment on lines +207 to +215
| Aspect | Detail |
| ------ | ------ |
| Default value | `5` |
| Direction | Lower number = higher precedence |
| Valid values | Integers (no fixed bounds) |
| Common range | `1` through `10` |
| Same-priority collision | Error — environment fails to build |
| Scope | File paths only — doesn't affect resolution |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it could be nice to make this table a bit more concise, and then put it as a cheatsheet closer to the top where there's currently the bulleted list Priority resolves these collisions:. That would make it easy to find for someone who just needs the really quick visible TLDR reminding them what valid values are and if higher or lower wins

Suggested change
| Aspect | Detail |
| ------ | ------ |
| Default value | `5` |
| Direction | Lower number = higher precedence |
| Valid values | Integers (no fixed bounds) |
| Common range | `1` through `10` |
| Same-priority collision | Error — environment fails to build |
| Scope | File paths only — doesn't affect resolution |
| Aspect | Detail |
| ------ | ------ |
| Default value | `5` |
| Direction | Lower number = higher precedence |
| Valid values | Integers (negatives allowed) |

(are negatives allowed? Idk)

Comment on lines +223 to +226
Nixpkgs provides convenience wrappers —
`lib.meta.hiPrio` (sets priority to -10) and
`lib.meta.lowPrio` (sets priority to 10) —
but in Flox you set the integer directly in the manifest.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure if we need to go into this much detail about nixpkgs?

Suggested change
Nixpkgs provides convenience wrappers —
`lib.meta.hiPrio` (sets priority to -10) and
`lib.meta.lowPrio` (sets priority to 10) —
but in Flox you set the integer directly in the manifest.

```text
> ❌ ERROR: 'cuda13.0-cuda_nvcc' conflicts with 'cuda13.0-libcublas'. Both packages provide the file 'LICENSE'
> Resolve by uninstalling one of the conflicting packages or setting the priority of the preferred package to a value lower than '5'
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like that this section includes the actual error - I wonder if it could be merged with this section above:

Most packages don't conflict, so you rarely need to think about priority. The situations where it matters are:

And I like that you use some actual examples throughout - I think dropping this packageA/packageB example and using thte same packages all the way through, starting with How priority works could be easier to follow

If a dependency isn't in the catalog,
you have several options.

### Provide the dependency as a Nix expression build
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we might want to clarify the organization of a few things for this page.

The intro for this page says it covers missing dependency vendoring but not sandbox vendoring, but then it has a sandbox vendoring section ("Download in an impure build stage"). I'm also not sure we should cover using flake inputs on a vendoring dependencies page.

The "## Manifest builds" section has a "### Provide the dependency as a Nix expression build" subsection. But then there's a separate "## Nix expression builds" section

We also have a number of examples in the https://flox.dev/docs/concepts/nix-expression-builds/#what-can-you-build section that have some overlap with some of these examples. E.g. this page has "Override an existing package's version", that page has "Example: Newer version of an existing package." Seems like we should clarify where to look for what information, and also de-duplicate it.

We have "Example: Vendor an existing package" (which also needs to be updated to use flox build import-nixpkgs instead of nix edit) which overlaps with this page as a whole

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