2024-11-01 15:56:50 +02:00
|
|
|
with import "${builtins.getEnv "_NIX_TEST_BUILD_DIR"}/config.nix";
|
2009-03-17 18:33:48 +02:00
|
|
|
|
|
|
|
rec {
|
|
|
|
|
2009-03-17 19:38:32 +02:00
|
|
|
printRefs =
|
2009-03-17 18:33:48 +02:00
|
|
|
''
|
2009-03-18 19:36:42 +02:00
|
|
|
echo $exportReferencesGraph
|
2009-03-17 18:33:48 +02:00
|
|
|
while read path; do
|
|
|
|
read drv
|
|
|
|
read nrRefs
|
|
|
|
echo "$path has $nrRefs references"
|
2009-03-17 19:38:32 +02:00
|
|
|
echo "$path" >> $out
|
2009-03-18 19:36:42 +02:00
|
|
|
for ((n = 0; n < $nrRefs; n++)); do read ref; echo "ref $ref"; test -e "$ref"; done
|
2009-03-17 18:33:48 +02:00
|
|
|
done < refs
|
|
|
|
'';
|
|
|
|
|
2013-11-18 12:21:12 +02:00
|
|
|
foo."bar.runtimeGraph" = mkDerivation {
|
2009-03-17 18:33:48 +02:00
|
|
|
name = "dependencies";
|
2009-03-17 19:38:32 +02:00
|
|
|
builder = builtins.toFile "build-graph-builder" "${printRefs}";
|
2023-08-23 15:00:00 +03:00
|
|
|
exportReferencesGraph = ["refs" (import ./dependencies.nix {})];
|
2009-03-17 18:33:48 +02:00
|
|
|
};
|
|
|
|
|
2013-11-18 12:21:12 +02:00
|
|
|
foo."bar.buildGraph" = mkDerivation {
|
2009-03-17 19:38:32 +02:00
|
|
|
name = "dependencies";
|
|
|
|
builder = builtins.toFile "build-graph-builder" "${printRefs}";
|
2023-08-23 15:00:00 +03:00
|
|
|
exportReferencesGraph = ["refs" (import ./dependencies.nix {}).drvPath];
|
2009-03-17 19:38:32 +02:00
|
|
|
};
|
|
|
|
|
2009-03-17 18:33:48 +02:00
|
|
|
}
|