Skip to content

Commit 0f31e24

Browse files
committed
guix: Add SUBSTITUTE_URLS option
1 parent 444fcfc commit 0f31e24

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

contrib/guix/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ find output/ -type f -print0 | sort -z | xargs -r0 sha256sum
147147
string) is interpreted the same way as not setting `V` at all, and that `V=0`
148148
has the same effect as `V=1`.
149149

150+
* _**SUBSTITUTE_URLS**_
151+
152+
A whitespace-delimited list of URLs from which to download pre-built packages.
153+
A URL is only used if its signing key is authorized (refer to the [substitute
154+
servers section](#speeding-up-builds-with-substitute-servers) for more
155+
details).
156+
150157
* _**ADDITIONAL_GUIX_ENVIRONMENT_FLAGS**_
151158

152159
Additional flags to be passed to `guix environment`. For a fully-bootstrapped
@@ -196,7 +203,7 @@ To use dongcarl's substitute server for Bitcoin Core builds after having
196203
[authorized his signing key](#authorize-the-signing-keys):
197204

198205
```
199-
export ADDITIONAL_GUIX_ENVIRONMENT_FLAGS='--substitute-urls="https://guix.carldong.io https://ci.guix.gnu.org"'
206+
export SUBSTITUTE_URLS='https://guix.carldong.io https://ci.guix.gnu.org'
200207
```
201208

202209
## FAQ

contrib/guix/guix-build.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git log --format=%at -1)}"
1616
# Execute "$@" in a pinned, possibly older version of Guix, for reproducibility
1717
# across time.
1818
time-machine() {
19+
# shellcheck disable=SC2086
1920
guix time-machine --url=https://github.com/dongcarl/guix.git \
2021
--commit=b066c25026f21fb57677aa34692a5034338e7ee3 \
2122
--max-jobs="$MAX_JOBS" \
23+
${SUBSTITUTE_URLS:+--substitute-urls="$SUBSTITUTE_URLS"} \
2224
-- "$@"
2325
}
2426

@@ -100,6 +102,16 @@ for host in ${HOSTS=x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv
100102
# make the downloaded depends sources available to it. The sources
101103
# should have been downloaded prior to this invocation.
102104
#
105+
# ${SUBSTITUTE_URLS:+--substitute-urls="$SUBSTITUTE_URLS"}
106+
#
107+
# fetch substitute from SUBSTITUTE_URLS if they are
108+
# authorized
109+
#
110+
# Depending on the user's security model, it may be desirable to use
111+
# substitutes (pre-built packages) from servers that the user trusts.
112+
# Please read the README.md in the same directory as this file for
113+
# more information.
114+
#
103115
# shellcheck disable=SC2086
104116
time-machine environment --manifest="${PWD}/contrib/guix/manifest.scm" \
105117
--container \
@@ -110,6 +122,7 @@ for host in ${HOSTS=x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv
110122
${SOURCES_PATH:+--share="$SOURCES_PATH"} \
111123
${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS} \
112124
--max-jobs="$MAX_JOBS" \
125+
${SUBSTITUTE_URLS:+--substitute-urls="$SUBSTITUTE_URLS"} \
113126
-- env HOST="$host" \
114127
MAX_JOBS="$MAX_JOBS" \
115128
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:?unable to determine value}" \

0 commit comments

Comments
 (0)