Skip to content

Fix compatibility with lazy trees - #242

Merged
edolstra merged 1 commit into
mainfrom
eelcodolstra/fh-922-flakehub-push-binary-cant-determine-the-path-of-the-flake
Jul 7, 2025
Merged

edolstra merged 1 commit into
mainfrom
eelcodolstra/fh-922-flakehub-push-binary-cant-determine-the-path-of-the-flake

Conversation

@edolstra

@edolstra edolstra commented Jul 7, 2025

Copy link
Copy Markdown
Contributor

nix flake metadata does not return a path attribute when lazy trees are enabled. We have to use nix flake prefetch to get a store path. (Ideally Nix would have a command to dump a source tree to stdout as a NAR or zip file so we don't have to copy it to the Nix store...)

`nix flake metadata` does not return a `path` attribute when lazy
trees are enabled. We have to use `nix flake prefetch` to get a store
path. (Ideally Nix would have a command to dump a source tree to
stdout as a NAR or zip file so we don't have to copy it to the Nix
store...)
@edolstra
edolstra enabled auto-merge July 7, 2025 18:28

@cole-h cole-h left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This does, however, break compatibility with versions of Nix that don't have this command (<2.27.0 according to my research). Just something to note. Otherwise LGTM.

@edolstra
edolstra added this pull request to the merge queue Jul 7, 2025
@edolstra

edolstra commented Jul 7, 2025

Copy link
Copy Markdown
Contributor Author

Hm, if that's an issue, we could check whether nix flake metadata returns path and only call nix flake prefetch if it doesn't.

@cole-h

cole-h commented Jul 7, 2025

Copy link
Copy Markdown
Member

I'm personally fine with this trade-off for now. If we get any issues about this, then we can change this to a fallback if there's no path in nix flake metadata.

Merged via the queue into main with commit 1dd8eaf Jul 7, 2025
@edolstra
edolstra deleted the eelcodolstra/fh-922-flakehub-push-binary-cant-determine-the-path-of-the-flake branch July 7, 2025 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants