Skip to content

Instantly share code, notes, and snippets.

@LnL7
Created June 11, 2020 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LnL7/a2d7d2e155a2bf3a71c28b27b21f4e1a to your computer and use it in GitHub Desktop.
Save LnL7/a2d7d2e155a2bf3a71c28b27b21f4e1a to your computer and use it in GitHub Desktop.
hydra-job-revision() {
local jobseteval job=$1
shift 1
case "$job" in
*'/'*) ;;
*) job="nixpkgs/trunk/$job" ;;
esac
case "$job" in
'http://'*|'https://'*) ;;
*) job="https://hydra.nixos.org/job/$job" ;;
esac
jobseteval=$(curl -fsSL -H 'Content-Type: application/json' "$job/latest" | jq '.jobsetevals[0]')
curl -fsSL -H 'Accept: application/json' "''${job%/job*}/eval/$jobseteval" | jq -r '.jobsetevalinputs.nixpkgs.revision'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment