build: Move guix time machine to prelude

This deduplicates some code, and enforces consistency of the time
machine configuration between scripts.
This commit is contained in:
laanwj
2022-03-07 11:08:46 +01:00
parent 3b08427b58
commit 6833aceac9
3 changed files with 16 additions and 29 deletions

View File

@@ -45,6 +45,22 @@ EOF
exit 1
fi
################
# Execute "$@" in a pinned, possibly older version of Guix, for reproducibility
# across time.
time-machine() {
# shellcheck disable=SC2086
guix time-machine --url=https://git.savannah.gnu.org/git/guix.git \
--commit=ae03f401381e956c4c41b4cf495cbde964fa43d0 \
--cores="$JOBS" \
--keep-failed \
--fallback \
${SUBSTITUTE_URLS:+--substitute-urls="$SUBSTITUTE_URLS"} \
${ADDITIONAL_GUIX_COMMON_FLAGS} ${ADDITIONAL_GUIX_TIMEMACHINE_FLAGS} \
-- "$@"
}
################
# Set common variables
################