summaryrefslogtreecommitdiff
path: root/scripts/build-installer
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-12-12 19:44:06 -0500
committerFreya Murphy <freya@freyacat.org>2024-12-12 19:44:06 -0500
commitdea0707f223e00b77e08f0997ba817cfaa8667cd (patch)
tree1099a6f2c4caf52b2cd376af2881b0ae013cd4c3 /scripts/build-installer
parentupdate nix commits (diff)
downloaddotfiles-guix-dea0707f223e00b77e08f0997ba817cfaa8667cd.tar.gz
dotfiles-guix-dea0707f223e00b77e08f0997ba817cfaa8667cd.tar.bz2
dotfiles-guix-dea0707f223e00b77e08f0997ba817cfaa8667cd.zip
update build-installer to work on non guix systems
Diffstat (limited to '')
-rwxr-xr-xscripts/build-installer25
1 files changed, 23 insertions, 2 deletions
diff --git a/scripts/build-installer b/scripts/build-installer
index e8fd399..f989d01 100755
--- a/scripts/build-installer
+++ b/scripts/build-installer
@@ -1,6 +1,27 @@
#!/bin/sh
retry="$(dirname $0)/guix-retry"
repo="$(realpath "$(dirname $0)/..")"
+extra_args=""
+
+if [ ! -d /gnu/store ]; 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)"
-image=$("$retry" guix system -L "$repo/modules" image -t iso9660 "$repo/systems/installer.scm")
-cp $image "./guix-installer-$date.iso"
+cp $image "guix-installer-$date.iso"