From 71a5161365f40699092e491bbff88473237fc432 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 3 Sep 2015 12:56:59 +0200 Subject: Implement buildDerivation() via the daemon --- src/nix-daemon/nix-daemon.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/nix-daemon/nix-daemon.cc') diff --git a/src/nix-daemon/nix-daemon.cc b/src/nix-daemon/nix-daemon.cc index 199d3288f..aaae691e9 100644 --- a/src/nix-daemon/nix-daemon.cc +++ b/src/nix-daemon/nix-daemon.cc @@ -7,6 +7,7 @@ #include "affinity.hh" #include "globals.hh" #include "monitor-fd.hh" +#include "derivations.hh" #include @@ -325,6 +326,20 @@ static void performOp(bool trusted, unsigned int clientVersion, break; } + case wopBuildDerivation: { + Path drvPath = readStorePath(from); + BasicDerivation drv; + from >> drv; + BuildMode buildMode = (BuildMode) readInt(from); + startWork(); + if (!trusted) + throw Error("you are not privileged to build derivations"); + auto res = store->buildDerivation(drvPath, drv, buildMode); + stopWork(); + to << res.status << res.errorMsg; + break; + } + case wopEnsurePath: { Path path = readStorePath(from); startWork(); -- cgit v1.2.3