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

nix-store: make --dump-db take a list of paths to dump #2579

Merged
merged 1 commit into from Feb 14, 2019

Conversation

catern
Copy link
Contributor

@catern catern commented Dec 13, 2018

Inside a derivation, exportReferencesGraph already provides a way to
dump the Nix database for a specific closure. On the command line,
--dump-db gave us the same information, but only for the entire Nix
database at once.

With this change, one can now pass a list of paths to --dump-db to get
the Nix database dumped for just those paths. (The user is responsible
for ensuring this is a closure, like for --export).

Among other things, this is useful for deploying a closure to a new
host without using --import/--export; one can use tar to transfer the
store paths, and --dump-db/--load-db to transfer the validity
information. This is useful if the new host doesn't actually have Nix
yet, and the closure that is being deployed itself contains Nix.

@lheckemann
Copy link
Member

👍 on the change in general!

This will only print the registration for the paths themselves, not their closure, right?

@catern
Copy link
Contributor Author

catern commented Dec 17, 2018

Correct, it's just the registration for the paths themselves, not their closure. Like with --export, the user is responsible for passing all the paths in a closure.

Copy link
Member

@lheckemann lheckemann left a comment

Choose a reason for hiding this comment

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

Not tested, but LGTM!

@lheckemann
Copy link
Member

Actually, this is missing documentation.

Inside a derivation, exportReferencesGraph already provides a way to
dump the Nix database for a specific closure. On the command line,
--dump-db gave us the same information, but only for the entire Nix
database at once.

With this change, one can now pass a list of paths to --dump-db to get
the Nix database dumped for just those paths. (The user is responsible
for ensuring this is a closure, like for --export).

Among other things, this is useful for deploying a closure to a new
host without using --import/--export; one can use tar to transfer the
store paths, and --dump-db/--load-db to transfer the validity
information. This is useful if the new host doesn't actually have Nix
yet, and the closure that is being deployed itself contains Nix.
@catern
Copy link
Contributor Author

catern commented Feb 13, 2019

Ping? @lheckemann

@lheckemann
Copy link
Member

LGTM still, but I can't merge it.

@edolstra edolstra merged commit d8fe447 into NixOS:master Feb 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants