tvl-depot/users/edef/depot-scan/wrap.nix
edef 68ab0a0705 chore(edef/users/depot-scan): move to a subdir
Change-Id: If202b466aa0874048e89e0dc270ff14883510131
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1652
Reviewed-by: edef <edef@edef.eu>
Tested-by: BuildkiteCI
2020-08-05 02:05:22 +00:00

15 lines
522 B
Nix

# this wraps import to override readFile and readDir to trace the files it touches
# technique inspired by lorri
let
global = {
import = global.scopedImport {};
scopedImport = x: builtins.scopedImport (global // x);
builtins = builtins // {
inherit (global) import scopedImport;
readFile = path: builtins.trace "depot-scan '${toString path}'" (builtins.readFile path);
readDir = path: builtins.trace "depot-scan '${toString path}'" (builtins.readDir path);
};
};
in global.import