diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2023-04-02 13:59:19 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2023-04-07 08:34:58 -0400 |
commit | 2b98af2e62f8a70cfa132f9bac7049a198309df8 (patch) | |
tree | 06416e6582ebd19a068c7ab661cfa1f3b9cd3366 /src/nix/derivation.cc | |
parent | 4e9f32f993aaa9f7995919e480e0e920d946184d (diff) |
`nix show-derivation` -> `nix derivation show`
Diffstat (limited to 'src/nix/derivation.cc')
-rw-r--r-- | src/nix/derivation.cc | 25 |
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"); |