Skip to content

Conversation

mikeland73
Copy link
Contributor

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-copy

There 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 mimic nix copy).
  • This command will support specifying the package you wish to copy. Packages can be nix installable, but also devbox packages (i.e. package@version). We could even support runx in the future.

I used copy to mimic nix command name, but I slightly prefer upload. 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"

@mikeland73 mikeland73 requested review from gcurtis, savil and ipince March 12, 2024 23:11
Copy link
Collaborator

@savil savil left a comment

Choose a reason for hiding this comment

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

The PR description plan makes sense. I like the suggested changes.

Comment on lines 27 to 28
Short: "Copy nix store paths to the cache",
Long: "Copies all nix packages in current project to url.",
Copy link
Collaborator

Choose a reason for hiding this comment

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

The long and the short mean quite different things. Which is it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could both be: "Copies all nix packages in current project to the cache at <url>"?

@mikeland73 mikeland73 merged commit ac1e50b into main Mar 14, 2024
@mikeland73 mikeland73 deleted the landau/nix-cache branch March 14, 2024 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants