From 2da6a424486e16b4b30e448a15a9b4a608df602d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 4 May 2017 14:16:26 +0200 Subject: nix dump-path: Add This is primarily useful for extracting NARs from other stores (like binary caches), which "nix-store --dump" cannot do. --- src/nix/command.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/nix/command.cc') diff --git a/src/nix/command.cc b/src/nix/command.cc index a45f2888b..3c82e0df5 100644 --- a/src/nix/command.cc +++ b/src/nix/command.cc @@ -129,4 +129,14 @@ void StorePathsCommand::run(ref store) run(store, storePaths); } +void StorePathCommand::run(ref store) +{ + auto storePaths = buildInstallables(store, false); + + if (storePaths.size() != 1) + throw UsageError("this command requires exactly one store path"); + + run(store, *storePaths.begin()); +} + } -- cgit v1.2.3