about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-12-16T13·32+0000
committerVincent Ambo <tazjin@google.com>2019-12-16T13·32+0000
commit0e5da6c34cc83a5f992bc3f3a2611b377ac5add3 (patch)
tree39c1d54e027af2d1f8d24b509dd218c0016a7714
parent6ae799e8c8a3ec5c90436be5757ac86e03e7ff4b (diff)
feat: Expose readTree for downstream consumers r/166
Exposes readTree from the package set but with a twist: It's exposed
as a functor that references the `.config` field from itself to get at
the configuration to be passed to packages.

This makes it possible for downstream users to make use of `readTree`
but with their own configuration.
-rw-r--r--default.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/default.nix b/default.nix
index b53aadcaf2e8..0fd79b93fd73 100644
--- a/default.nix
+++ b/default.nix
@@ -38,6 +38,12 @@ in fix(self: {
 
   # Elevate 'lib' from nixpkgs
   lib = import (self.third_party.nixpkgsSrc + "/lib");
+
+  # Expose readTree for downstream repo consumers.
+  readTree = {
+    __functor = x: (readTree' x.config);
+    config = self.config;
+  };
 }
 
 # Add local packages as structured by readTree