1
0

Compare commits

..

No commits in common. "a6554dc4989d0093b7430eb29c10b1c24283327d" and "e9d4f37d164ac114fd668c23fa988b17e06f5320" have entirely different histories.

View File

@ -2,37 +2,17 @@
set -euo pipefail set -euo pipefail
xgit() { NOW="$(date --utc --iso-8601=minutes)"
git -c "user.name=Flake Update Bot" -c "user.email=flake-update-bot@clerie.de" "$@"
}
NOW="$(date --utc +%Y-%m-%d-%H-%M)"
xgit status || xgit clone gitea@git.clerie.de:clerie/nixfiles.git .
git status || git clone gitea@git.clerie.de:clerie/nixfiles.git .
echo "[!] Download changes" echo "[!] Download changes"
xgit fetch --all git fetch --all
git checkout updated-inputs
echo "[!] Chechout remote master" git -c "user.name=Flake Update Bot" -c "user.email=flake-update-bot@clerie.de" merge -s ort -X theirs origin/master -m "Update from master ${NOW}"
xgit checkout origin/master echo "[!] Update inputs"
nix flake update
UPDATE_BRANCH="update-inputs-${NOW}"
echo "[!] Create branch ${UPDATE_BRANCH}"
xgit checkout -b "${UPDATE_BRANCH}"
echo "[!] Update nixpkgs"
nix flake lock --update-input nixpkgs
echo "[!] Commit changes" echo "[!] Commit changes"
xgit add flake.lock git add flake.lock
xgit commit -m "Update nixpkgs ${NOW}" || true git -c "user.name=Flake Update Bot" -c "user.email=flake-update-bot@clerie.de" commit -m "Flake update ${NOW}" || true
echo "[!] Publish"
echo "[!] Publish ${UPDATE_BRANCH}" git push origin updated-inputs
xgit push --set-upstream origin "${UPDATE_BRANCH}"
echo "[!] Merge ${UPDATE_BRANCH} into updated-inputs"
xgit checkout updated-inputs
xgit merge -s ort -X theirs "${UPDATE_BRANCH}" -m "Update from ${UPDATE_BRANCH}"
echo "[!] Publish updated-inputs"
xgit push origin updated-inputs