aboutsummaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix')
-rw-r--r--nix/libstore/builtins.cc10
-rw-r--r--nix/libstore/builtins.hh3
-rw-r--r--nix/libstore/worker-protocol.hh5
-rw-r--r--nix/nix-daemon/nix-daemon.cc9
4 files changed, 25 insertions, 2 deletions
diff --git a/nix/libstore/builtins.cc b/nix/libstore/builtins.cc
index 605e44079a..32af767dc4 100644
--- a/nix/libstore/builtins.cc
+++ b/nix/libstore/builtins.cc
@@ -66,4 +66,14 @@ derivationBuilder lookupBuiltinBuilder(const std::string & name)
return NULL;
}
+std::list<std::string> builtinBuilderNames()
+{
+ std::list<std::string> result;
+ for(auto&& iter: builtins)
+ {
+ result.push_back(iter.first);
+ }
+ return result;
+}
+
}
diff --git a/nix/libstore/builtins.hh b/nix/libstore/builtins.hh
index 0c6db651ab..79171fcb6c 100644
--- a/nix/libstore/builtins.hh
+++ b/nix/libstore/builtins.hh
@@ -38,4 +38,7 @@ namespace nix {
/* Return the built-in builder called BUILDER, or NULL if none was
found. */
derivationBuilder lookupBuiltinBuilder(const std::string &builder);
+
+ /* Return the list of supported built-in builder names. */
+ std::list<std::string> builtinBuilderNames();
}
diff --git a/nix/libstore/worker-protocol.hh b/nix/libstore/worker-protocol.hh
index 7b7be4a8a0..bdeaca2e3a 100644
--- a/nix/libstore/worker-protocol.hh
+++ b/nix/libstore/worker-protocol.hh
@@ -6,7 +6,7 @@ namespace nix {
#define WORKER_MAGIC_1 0x6e697863
#define WORKER_MAGIC_2 0x6478696f
-#define PROTOCOL_VERSION 0x10f
+#define PROTOCOL_VERSION 0x160
#define GET_PROTOCOL_MAJOR(x) ((x) & 0xff00)
#define GET_PROTOCOL_MINOR(x) ((x) & 0x00ff)
@@ -43,7 +43,8 @@ typedef enum {
wopQuerySubstitutablePaths = 32,
wopQueryValidDerivers = 33,
wopOptimiseStore = 34,
- wopVerifyStore = 35
+ wopVerifyStore = 35,
+ wopBuiltinBuilders = 80
} WorkerOp;
diff --git a/nix/nix-daemon/nix-daemon.cc b/nix/nix-daemon/nix-daemon.cc
index 35c284f7e1..9b29b3e91d 100644
--- a/nix/nix-daemon/nix-daemon.cc
+++ b/nix/nix-daemon/nix-daemon.cc
@@ -6,6 +6,7 @@
#include "archive.hh"
#include "affinity.hh"
#include "globals.hh"
+#include "builtins.hh"
#include <algorithm>
@@ -671,6 +672,14 @@ static void performOp(bool trusted, unsigned int clientVersion,
break;
}
+ case wopBuiltinBuilders: {
+ startWork();
+ auto names = builtinBuilderNames();
+ stopWork();
+ writeStrings(names, to);
+ break;
+ }
+
default:
throw Error(format("invalid operation %1%") % op);
}