2020-08-05 03:48:16 +02:00
|
|
|
# this wraps import to override readFile and readDir to trace the files it touches
|
|
|
|
# technique inspired by lorri
|
|
|
|
let
|
|
|
|
|
|
|
|
global = {
|
2022-01-30 17:06:58 +01:00
|
|
|
import = global.scopedImport { };
|
2020-08-05 03:48:16 +02:00
|
|
|
scopedImport = x: builtins.scopedImport (global // x);
|
|
|
|
builtins = builtins // {
|
|
|
|
inherit (global) import scopedImport;
|
|
|
|
readFile = path: builtins.trace "depot-scan '${toString path}'" (builtins.readFile path);
|
2022-01-30 17:06:58 +01:00
|
|
|
readDir = path: builtins.trace "depot-scan '${toString path}'" (builtins.readDir path);
|
2020-08-05 03:48:16 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-01-30 17:06:58 +01:00
|
|
|
in
|
|
|
|
global.import
|