dotfiles-guix/scripts/build-installer

29 lines
847 B
Text
Raw Normal View History

2024-12-12 20:20:14 +00:00
#!/bin/sh
2024-12-13 00:15:02 +00:00
retry="$(dirname $0)/guix-retry"
repo="$(realpath "$(dirname $0)/..")"
extra_args=""
2024-12-13 03:53:10 +00:00
if [ -f /usr/local/bin ]; then
# we are likely in a non guix system
# just for building the installer
# make sure to authorize the substitute
# servers for nonguix and sakura
guix archive --authorize < "$repo/files/keys/nonguix.pub"
guix archive --authorize < "$repo/files/keys/sakura.pub"
2024-12-13 00:47:44 +00:00
substitutes=$(
(cat <<EOF
https://substitutes.nonguix.org
https://substitutes.freya.cat
https://bordeaux.guix.gnu.org
https://ci.guix.gnu.org
EOF
) | tr '\n' ' ')
extra_args="--substitute-urls=\"$substitutes\""
fi
command="\"$retry\" guix time-machine -C \"$repo/channels.scm\" $extra_args -- system -L \"$repo/modules\" image -t iso9660 \"$repo/systems/installer.scm\""
image=$(sh -c "$command")
2024-12-12 20:20:14 +00:00
date="$(date -Iseconds)"
cp $image "guix-installer-$date.iso"