From ac41d89ba5d715918324c49630d0eac8283c4895 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 13 Nov 2021 18:33:34 +0100 Subject: refactor(readTree): Flip argument order of argFilter Since the filters return 'args', this makes nesting of filters more readable. Change-Id: I775252460e3e077cc6db2fab6f3948414a95ecbf Reviewed-on: https://cl.tvl.fyi/c/depot/+/3873 Tested-by: BuildkiteCI Reviewed-by: sterni --- nix/readTree/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nix') diff --git a/nix/readTree/default.nix b/nix/readTree/default.nix index 2746d8c907..c3955c6c88 100644 --- a/nix/readTree/default.nix +++ b/nix/readTree/default.nix @@ -64,7 +64,7 @@ let in if pathType != "lambda" then builtins.throw "readTree: trying to import ${toString path}, but it’s a ${pathType}, you need to make it a function like { depot, pkgs, ... }" - else importedFile (filter (argsWithPath args parts) parts); + else importedFile (filter parts (argsWithPath args parts)); nixFileName = file: let res = match "(.*)\\.nix" file; @@ -129,7 +129,7 @@ in { __functor = _: { path , args - , filter ? (x: _parts: x) + , filter ? (_parts: x: x) , scopedArgs ? {} }: readTree { inherit args scopedArgs; -- cgit 1.4.1