aboutsummaryrefslogtreecommitdiff
path: root/src/nix/derivation.cc
blob: cd3975a4f39726bef7068441f88c19e2414eb000 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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");