[nix-cache] Add cache copy command #1891
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Note: this may not be the final UX for this command. I'm just getting it in hidden so we can build the cache feature end-to-end and will refine details later.
Adds
devbox cache copy <url>
command. It copies the current devbox nix profile to the url.<url>
can be anything supported by https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-copyThere are two future plans for this command:
url
will be optional when logged in. It will be determined by API in those cases. We may want to move url to be a flag in that case (possibly the--to
flag to mimicnix copy
).I used
copy
to mimicnix
command name, but I slightly preferupload
. That and the above changes would make this command look like:devbox cache upload [--to <url>] [package]
or as simple as
devbox cache upload
to upload current profile when logged in.
How was it tested?
devbox cache copy "s3://mike-test-nix-cache?region=us-west-2"