about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-02-21T12·45+0000
committerVincent Ambo <tazjin@google.com>2020-02-21T12·45+0000
commit5d9d84f4cfdbed049e71ce6f15bb1ad8650f7acf (patch)
tree7593a25f32da61bb85894f01082479aa2a674a66
parent0e54b3eb6a5ab02d79fe9b22fede912cc83bfc36 (diff)
refactor: Pass the depot as an argument named 'depot' r/558
This change, which I've been meaning to do for a while, renames the
attributes passed by readTree to things in the tree so that:

* the depot root is now 'depot'
* depot.third_party is additionally passed as 'pkgs' (for
  compatibility with exported subtrees)
-rw-r--r--default.nix10
1 files changed, 7 insertions, 3 deletions
diff --git a/default.nix b/default.nix
index cda18ee7f3b9..cf70c704a99f 100644
--- a/default.nix
+++ b/default.nix
@@ -15,8 +15,12 @@ let
   fix = f: let x = f x; in x;
 
   # Global configuration that all packages are called with.
-  config = pkgs: {
-    inherit pkgs;
+  config = depot: {
+    inherit depot;
+
+    # Pass third_party as 'pkgs' (for compatibility with external
+    # imports for certain subdirectories)
+    pkgs = depot.third_party;
 
     kms = {
       project = "tazjins-infrastructure";
@@ -58,5 +62,5 @@ in fix(self: {
 #
 # This can be used to move things from third_party into the top-level, too (such
 # as `lib`).
-// (readTree' { pkgs = self; }) ./overrides
+// (readTree' { depot = self; pkgs = self.third_party; }) ./overrides
 )