aboutsummaryrefslogtreecommitdiff
path: root/src/nix/derivation.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-04-02 13:59:19 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-04-07 08:34:58 -0400
commit2b98af2e62f8a70cfa132f9bac7049a198309df8 (patch)
tree06416e6582ebd19a068c7ab661cfa1f3b9cd3366 /src/nix/derivation.cc
parent4e9f32f993aaa9f7995919e480e0e920d946184d (diff)
`nix show-derivation` -> `nix derivation show`
Diffstat (limited to 'src/nix/derivation.cc')
-rw-r--r--src/nix/derivation.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/nix/derivation.cc b/src/nix/derivation.cc
new file mode 100644
index 000000000..cd3975a4f
--- /dev/null
+++ b/src/nix/derivation.cc
@@ -0,0 +1,25 @@
+#include "command.hh"
+
+using namespace nix;
+
+struct CmdDerivation : virtual NixMultiCommand
+{
+ CmdDerivation() : MultiCommand(RegisterCommand::getCommandsFor({"derivation"}))
+ { }
+
+ std::string description() override
+ {
+ return "Work with derivations, Nix's notion of a build plan.";
+ }
+
+ Category category() override { return catUtility; }
+
+ void run() override
+ {
+ if (!command)
+ throw UsageError("'nix derivation' requires a sub-command.");
+ command->second->run();
+ }
+};
+
+static auto rCmdDerivation = registerCommand<CmdDerivation>("derivation");