dotfiles-guix/scripts/build-installer
Freya Murphy c0802ee805
Some checks failed
installer / build (push) Failing after 25m34s
add guix installer workflow
2024-12-14 14:22:54 -05:00

28 lines
847 B
Bash
Executable file

#!/bin/sh
retry="$(dirname $0)/guix-retry"
repo="$(realpath "$(dirname $0)/..")"
extra_args=""
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"
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")
date="$(date -Iseconds)"
cp $image "guix-installer-$date.iso"