about summary refs log tree commit diff
path: root/src/nix/command.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-05-04T12·16+0200
committerEelco Dolstra <edolstra@gmail.com>2017-05-04T12·21+0200
commit2da6a424486e16b4b30e448a15a9b4a608df602d (patch)
tree714f354bd9df41fd4b9ef3f5d391fc64aa1003bc /src/nix/command.hh
parent44309c506767fcfb8aae15761b329a87b0dd4b8c (diff)
nix dump-path: Add
This is primarily useful for extracting NARs from other stores (like
binary caches), which "nix-store --dump" cannot do.
Diffstat (limited to 'src/nix/command.hh')
-rw-r--r--src/nix/command.hh10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nix/command.hh b/src/nix/command.hh
index cf0097d78926..4800b5c912e4 100644
--- a/src/nix/command.hh
+++ b/src/nix/command.hh
@@ -118,6 +118,16 @@ public:
     bool useDefaultInstallables() override { return !all; }
 };
 
+/* A command that operates on exactly one store path. */
+struct StorePathCommand : public InstallablesCommand
+{
+    using StoreCommand::run;
+
+    virtual void run(ref<Store> store, const Path & storePath) = 0;
+
+    void run(ref<Store> store) override;
+};
+
 typedef std::map<std::string, ref<Command>> Commands;
 
 /* An argument parser that supports multiple subcommands,