-
Notifications
You must be signed in to change notification settings - Fork 2
nix flake clone: Support all input types #229
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
nix flake clone: Support all input types #229
Conversation
For input types that have no concept of cloning, we now default to copying the entire source tree.
WalkthroughIntroduces a store-aware cloning pathway. Updates clone method signatures in Input, InputScheme, and scheme implementations (Git, GitHub, GitLab, SourceHut) to accept ref and std::filesystem::path. CmdFlakeClone updated to pass store. Implements store-backed cloning in fetchers.cc. Adds functional tests for cloning tarball flakes and existing-destination errors. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant CLI as nix flake clone
participant Store
participant Input as Input
participant Scheme as InputScheme
participant FS as Filesystem
User->>CLI: nix flake clone URL destDir
CLI->>Store: resolve(URL)
Store-->>CLI: Input
CLI->>Input: clone(Store, destDir)
Input->>Scheme: clone(Store, Input, destDir)
rect rgba(220,235,255,0.5)
note over Scheme: Store-backed cloning
Scheme->>FS: check destDir exists
alt dest exists
Scheme-->>CLI: error (path exists)
else
Scheme->>Store: makeAccessor(Input)
Scheme->>Store: openSink(destDir)
Store-->>Scheme: sink
Scheme->>Store: stream accessor -> sink
Scheme->>Store: restorePath(sink)
Scheme-->>CLI: success
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
🧰 Additional context used🧬 Code graph analysis (6)src/libfetchers/git.cc (1)
tests/functional/flakes/flakes.sh (1)
src/libfetchers/include/nix/fetchers/fetchers.hh (2)
src/nix/flake.cc (1)
src/libfetchers/fetchers.cc (4)
src/libfetchers/github.cc (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (1)
Comment |
Motivation
This makes
nix flake clonework on all input types, including tarballs, e.g.Context
Summary by CodeRabbit