-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relative git flake inputs git+file:relative/path
#12281
Comments
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-01-22-nix-team-meeting-minutes-210/59239/1 |
I saw warnings like |
This use case was never intentionally supported, and we are working towards a situation where you don't have to specify such inputs at all, and you can just refer to them by relative path value, e.g. Thanks to @edolstra's implementation work on #10089 and #12421, you will be able to simplify your flake. Flakes are an experimental feature, because it was originally developed by @edolstra with a limited budget that did not cover the project's completion. Its experimental release caused a lot of user interest, but only limited investment since its initial creation. (Hence why some users, who unfortunately feel powerless, have resorted to complaining instead of helping out an open source project in need.) It is experimental exactly because we discover situations like this, where users find workarounds that are broken, and which are not feasible to support in a form that resembles the workaround.
These are implementation details of flakes, where You may ignore this warning. We appreciate your patience and contribution while we work towards flakes features that we can support sustainably into the future, as that is an important promise of the (stable parts of the) Nix project. |
I've updated the issue description to add a solution specifically for flakes users. Feel free to ask me if anything is still unclear. |
Thank you very much for clarification. Indeed, I recall there was a problem with relative paths, which is why I ended up with |
Is your feature request related to a problem?
git+file:relative/path
according to the process working directory instead of theflake.nix
base directory. This is unreliable. Evaluation should be invariant under the process working directory, or it would violate the ability to be used as a flake input, among other things.fetchTree
does not have a base directory argument (and no implicit argument either, because that'd also be bad)fetchTree
does not have the information to resolve relative paths.Solution for Flakes users
Users will be able to use a relative path reference since Nix 2.26 and they can enable submodules declaratively, planned for release in 2.27
inputs.self.submodules
flake attribute #12421For Nix 2.26, instead of
inputs.self.submodules
, use:Proposed solution (for
fetchTree
)fetchTree
call-flake.nix
(with a primop that does it? - unclear if that's future proof enough for reproducibility)baseDirectory
argument tofetchTree
Alternative solution
Forbid altogether. This blocks some users:
git+file:./${submodule}
no longer works #9708Additional context
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: