From 96e4027988a35126df33b8d1347bc45373a6fdd3 Mon Sep 17 00:00:00 2001 From: anntnzrb Date: Tue, 22 Jun 2021 10:18:19 -0500 Subject: [PATCH] Fixed local iso building --- .github/workflows/build.yaml | 4 +-- .gitignore | 4 +-- build-iso.sh | 40 ++++++++++++++++++++++++----- guix/base-channels.scm | 12 +++++++++ installer.scm => guix/installer.scm | 0 5 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 guix/base-channels.scm rename installer.scm => guix/installer.scm (100%) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8599300..4db1b5f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -37,10 +37,10 @@ jobs: - name: Build ISO run: | # Write out the channels file so it can be included - guix describe -f channels > channels.scm + guix time-machine -C './guix/base-channels.scm' -- describe -f channels > './guix/channels.scm' # Build the image - image=$(guix system image -t iso9660 installer.scm) + image=$(guix time-machine -C './guix/channels.scm' -- system image -t iso9660 './guix/installer.scm') # Copy the image to the local folder with a better name export RELEASE_TAG=$(date +"%Y%m%d%H%M") diff --git a/.gitignore b/.gitignore index f3b41b5..313b901 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -./channels.scm -./guix-installer.iso \ No newline at end of file +*.iso +./guix/channels.scm diff --git a/build-iso.sh b/build-iso.sh index 6f72bd9..0a284c5 100755 --- a/build-iso.sh +++ b/build-iso.sh @@ -1,9 +1,37 @@ #!/bin/sh -# Write out the current channels to be included with the image -guix describe -f channels > ./channels.scm +# ----------------------------------------------------------------------------- +# Utilities +# ----------------------------------------------------------------------------- -# Build the image and copy it to the current directory -image=$(guix system image -t iso9660 ./installer.scm) -echo "Built image: $image" -cp $image ./guix-installer.iso +die() { + # ** + # Prints a message to stderr & exits script with non-successful code "1" + # * + + printf '%s\n' "$@" >&2 + exit 1 +} + +# ----------------------------------------------------------------------------- +# Main +# ----------------------------------------------------------------------------- + +# Write out the channels file so it can be included +guix time-machine -C './guix/base-channels.scm' -- \ + describe -f channels > './guix/channels.scm' + +# Build the image +printf 'Attempting to build the image...\n\n' +image=$(guix time-machine -C './guix/channels.scm' -- system image -t iso9660 './guix/installer.scm') \ + || die 'Could not create image.' + +release_tag=$(date +"%Y%m%d%H%M") +cp "${image}" "./guix-installer-${release_tag}.iso" || + die 'An error occurred while copying.' + +printf 'Image was succesfully built: %s\n' "${image}" + +# cleanup +unset -f die +unset -v image release_tag diff --git a/guix/base-channels.scm b/guix/base-channels.scm new file mode 100644 index 0000000..1db5fcf --- /dev/null +++ b/guix/base-channels.scm @@ -0,0 +1,12 @@ +;; Reference :: https://gitlab.com/nonguix/nonguix + +(cons* (channel + (name 'nonguix) + (url "https://gitlab.com/nonguix/nonguix") + ;; Enable signature verification: + (introduction + (make-channel-introduction + "897c1a470da759236cc11798f4e0a5f7d4d59fbc" + (openpgp-fingerprint + "2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5")))) + %default-channels) diff --git a/installer.scm b/guix/installer.scm similarity index 100% rename from installer.scm rename to guix/installer.scm