Skip to content
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

Open
roberth opened this issue Jan 16, 2025 · 1 comment
Open

Relative git flake inputs git+file:relative/path #12281

roberth opened this issue Jan 16, 2025 · 1 comment
Labels
bug feature Feature request or proposal fetching Networking with the outside (non-Nix) world, input locking idea approved The given proposal has been discussed and approved by the Nix team. An implementation is welcome.

Comments

@roberth
Copy link
Member

roberth commented Jan 16, 2025

Is your feature request related to a problem?

    • Nix currently resolves git+file:relative/path according to the process working directory instead of the flake.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)
  • Therefore fetchTree does not have the information to resolve relative paths.

Proposed solution

  • Disallow git relative path inputs in fetchTree
  • Either
    • Resolve git relative path inputs in call-flake.nix (with a primop that does it? - unclear if that's future proof enough for reproducibility)
    • add a baseDirectory argument to fetchTree

Alternative solutions

Forbid altogether. This blocks some users:

Additional context


Add 👍 to issues you find important.

@roberth roberth added bug feature Feature request or proposal fetching Networking with the outside (non-Nix) world, input locking labels Jan 16, 2025
@tomberek tomberek added the idea approved The given proposal has been discussed and approved by the Nix team. An implementation is welcome. label Jan 22, 2025
@nixos-discourse
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug feature Feature request or proposal fetching Networking with the outside (non-Nix) world, input locking idea approved The given proposal has been discussed and approved by the Nix team. An implementation is welcome.
Projects
None yet
Development

No branches or pull requests

3 participants