1
0
Fork 0
forked from emily/nixfiles
nixfiles-emily/pkgs/update-nixfiles/update-nixfiles.sh
2024-05-16 14:37:15 +02:00

26 lines
716 B
Bash

#!/usr/bin/env bash
set -euo pipefail
BRANCH="update-inputs"
HYDRA_URL="https://hydra.kyouma.net"
JOBSET_URL="${HYDRA_URL}/jobset/nixfiles/update-inputs"
ROOT="$(mktemp -d)"
test_build () {
local build_jobs
build_jobs="$(curl --fail -s -L -H "Accept: application/json" "${JOBSET_URL}/latest-eval" | jq -r ".builds | .[]")"
for build in ${build_jobs}; do
local build_url
build_status="$(curl -s -L -H "Accept: application/json" "https://hydra.kyouma.net/build/${build}" | jq -r ".buildstatus")"
[[ $build_status != 0 ]] && exit 1
done
}
git clone git@git.bsd.gay:snaki/nixfiles.git
git checkout -b "${BRANCH}"
nix flake update --commit-lock-file
git push --set-upstream origin "${BRANCH}"