Merge pull request #5 from anntnzrb/patch-1

Fixed manual (local) building
pull/8/head
David Wilson 2021-06-23 18:05:07 +03:00 committed by GitHub
commit 92a3e11f82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 50 additions and 22 deletions

View File

@ -21,26 +21,14 @@ jobs:
- name: Install Guix - name: Install Guix
uses: PromyLOPh/guix-install-action@v1 uses: PromyLOPh/guix-install-action@v1
with:
channels: |
(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)
- name: Build ISO - name: Build ISO
run: | run: |
# Write out the channels file so it can be included # 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 # 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 # Copy the image to the local folder with a better name
export RELEASE_TAG=$(date +"%Y%m%d%H%M") export RELEASE_TAG=$(date +"%Y%m%d%H%M")

4
.gitignore vendored
View File

@ -1,2 +1,2 @@
channels.scm *.iso
guix-installer.iso ./guix/channels.scm

View File

@ -1,9 +1,37 @@
#!/bin/sh #!/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 die() {
image=$(guix system image -t iso9660 installer.scm) # **
echo "Built image: $image" # Prints a message to stderr & exits script with non-successful code "1"
cp $image ./guix-installer.iso # *
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

12
guix/base-channels.scm Normal file
View File

@ -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)