about summary refs log tree commit diff
path: root/tools/nixery/group-layers/popcount
blob: 83baf3045da7c8c54e51ab871debdc8eb930d6a7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash
set -ueo pipefail

function graphsFor() {
  local pkg="${1}"
  local graphs=$(nix-build --timeout 2 --argstr target "${pkg}" popcount.nix || echo -n 'empty.json')
  cat $graphs | jq -r -cM '.[] | .references[]'
}

for pkg in $(cat all-top-level.json | jq -r '.[]'); do
  graphsFor "${pkg}" 2>/dev/null
  echo "Printed refs for ${pkg}" >&2
done