From b4b5e9ce2f58aecea2fe3ca1fe9388e4fc7df556 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Fri, 2 Sep 2016 14:26:02 -0400 Subject: Add narFromPath op to nix daemon --- src/libstore/worker-protocol.hh | 1 + src/nix-daemon/nix-daemon.cc | 8 ++++++++ 2 files changed, 9 insertions(+) (limited to 'src') diff --git a/src/libstore/worker-protocol.hh b/src/libstore/worker-protocol.hh index f8cd7cc4be29..c7f024efe749 100644 --- a/src/libstore/worker-protocol.hh +++ b/src/libstore/worker-protocol.hh @@ -46,6 +46,7 @@ typedef enum { wopVerifyStore = 35, wopBuildDerivation = 36, wopAddSignatures = 37, + wopNarFromPath = 38 } WorkerOp; diff --git a/src/nix-daemon/nix-daemon.cc b/src/nix-daemon/nix-daemon.cc index fba522540b69..0ef2a6872141 100644 --- a/src/nix-daemon/nix-daemon.cc +++ b/src/nix-daemon/nix-daemon.cc @@ -576,6 +576,14 @@ static void performOp(ref store, bool trusted, unsigned int clientVe break; } + case wopNarFromPath: { + auto path = readStorePath(*store, from); + startWork(); + dumpPath(path, to); + stopWork(); + break; + } + default: throw Error(format("invalid operation %1%") % op); } -- cgit 1.4.1