diff options
author | Vincent Ambo <mail@tazj.in> | 2021-09-08T15·16+0300 |
---|---|---|
committer | tazjin <mail@tazj.in> | 2021-09-08T17·58+0000 |
commit | aedde913d125737f81e63edbc7481e886b0a4f2d (patch) | |
tree | 980613a19c4759ddbd40d28c4ad8769ea777f330 /nix/readTree/README.md | |
parent | 4c4aa8e4136dfbfd6f8c8c0979f1d91236a44346 (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 'nix/readTree/README.md')
-rw-r--r-- | nix/readTree/README.md | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/nix/readTree/README.md b/nix/readTree/README.md index 138abbe30583..b56bc944caba 100644 --- a/nix/readTree/README.md +++ b/nix/readTree/README.md @@ -70,8 +70,13 @@ the tree as empty nodes (`{}`). ## Import structure -`readTree` is called with two parameters: The arguments to pass to all imports, -and the initial path at which to start the traversal. +`readTree` is called with an argument set containing a few parameters: + +* `path`: Initial path at which to start the traversal. +* `args`: Arguments to pass to all imports. +* `filter`: (optional) A function to filter the argument set on each + import based on the location in the tree. This can be used to, for + example, implement a "visibility" system inside of a tree. The package headers in this repository follow the form `{ pkgs, ... }:` where `pkgs` is a fixed-point of the entire package tree (see the `default.nix` at the |