depot/third_party/nixpkgs/pkgs/build-support/references-by-popularity/default.nix
Default email 2c76a4cb41 Project import generated by Copybara.
GitOrigin-RevId: c757e9bd77b16ca2e03c89bf8bc9ecb28e0c06ad
2023-11-16 04:20:00 +00:00

13 lines
401 B
Nix

{ runCommand, python3, coreutils }:
# Write the references of `path' to a file, in order of how "popular" each
# reference is. Nix 2 only.
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]}
''