core/pkgs/build-support/references-by-popularity/default.nix

22 lines
442 B
Nix
Raw Normal View History

2024-06-30 08:16:52 +00:00
{
runCommand,
python3,
coreutils,
}:
2024-05-02 00:46:19 +00:00
# Write the references of `path' to a file, in order of how "popular" each
# reference is. Nix 2 only.
2024-06-30 08:16:52 +00:00
path:
runCommand "closure-paths"
{
exportReferencesGraph.graph = path;
__structuredAttrs = true;
preferLocalBuild = true;
nativeBuildInputs = [
coreutils
python3
];
}
''
python3 ${./closure-graph.py} "$NIX_ATTRS_JSON_FILE" graph > ''${outputs[out]}
''