nix dump-path: Add

This is primarily useful for extracting NARs from other stores (like
binary caches), which "nix-store --dump" cannot do.
This commit is contained in:
Eelco Dolstra 2017-05-04 14:16:26 +02:00
parent 44309c5067
commit 2da6a42448
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
3 changed files with 55 additions and 0 deletions

View file

@ -129,4 +129,14 @@ void StorePathsCommand::run(ref<Store> store)
run(store, storePaths);
}
void StorePathCommand::run(ref<Store> store)
{
auto storePaths = buildInstallables(store, false);
if (storePaths.size() != 1)
throw UsageError("this command requires exactly one store path");
run(store, *storePaths.begin());
}
}