about summary refs log tree commit diff
path: root/default.nix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-09-08T15·16+0300
committertazjin <mail@tazj.in>2021-09-08T17·58+0000
commitaedde913d125737f81e63edbc7481e886b0a4f2d (patch)
tree980613a19c4759ddbd40d28c4ad8769ea777f330 /default.nix
parent4c4aa8e4136dfbfd6f8c8c0979f1d91236a44346 (diff)
refactor(readTree): Pass all readTree parameters as function args r/2824
Instead of having a mix of depot-passed args (for the filter) and args
to the readTree function itself, make everything a single attribute
set of arguments passed to the function.

This also makes it a bit easier to extend this in the future.

Change-Id: I633c1fc96026d137b451bb604ef92be32571a0f5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3498
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix10
1 files changed, 6 insertions, 4 deletions
diff --git a/default.nix b/default.nix
index 19c00bb2c4..bb9bc703bf 100644
--- a/default.nix
+++ b/default.nix
@@ -56,8 +56,10 @@ let
       };
     };
 
-    readTree' = import ./nix/readTree {
-      argsFilter = depotArgsFilter;
+    readDepot = depotArgs: import ./nix/readTree {} {
+      args = depotArgs;
+      path = ./.;
+      filter = depotArgsFilter;
     };
 
   # To determine build targets, we walk through the depot tree and
@@ -91,7 +93,7 @@ let
            (node.meta.targets or []))
     else [];
 
-in fix(self: (readTree' {
+in fix(self: (readDepot {
   depot = self;
 
   # Pass third_party as 'pkgs' (for compatibility with external
@@ -107,7 +109,7 @@ in fix(self: (readTree' {
   # Note that it is intended for exceptional circumstance, such as
   # debugging by bisecting nixpkgs.
   externalArgs = args;
-} ./.) // {
+}) // {
   # Make the path to the depot available for things that might need it
   # (e.g. NixOS module inclusions)
   path = ./.;