Skip to content

Commit

Permalink
Replace guix-install.sh
Browse files Browse the repository at this point in the history
Fixes #20.
  • Loading branch information
PromyLOPh committed Mar 26, 2023
1 parent 82df1aa commit accc254
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Expand Up @@ -15,7 +15,7 @@ jobs:
guix-cache-
# Cannot use a cache for /gnu/store, since restore fails
- name: Install Guix
uses: PromyLOPh/guix-install-action@v1
uses: PromyLOPh/guix-install-action@custom-guix-install
- name: Ensure no locale warning
run: test -z "$(guix --version 2>&1 >/dev/null)"
- name: Build hello
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
# Cannot use a cache for /gnu/store, since restore fails
- name: Install Guix
id: install-guix
uses: PromyLOPh/guix-install-action@v1
uses: PromyLOPh/guix-install-action@custom-guix-install
with:
channels: |-
(cons
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
steps:
- name: Install Guix
id: install-guix
uses: PromyLOPh/guix-install-action@v1
uses: PromyLOPh/guix-install-action@custom-guix-install
with:
pullAfterInstall: false
- name: Build hello
Expand Down
48 changes: 24 additions & 24 deletions action.yml
Expand Up @@ -33,21 +33,34 @@ runs:
shell: bash
name: Set LANG
- run: |
wget -nv https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh -O guix-install.sh
wget -nv https://ci.guix.gnu.org/search/latest/archive?query=spec:tarball+status:success+system:x86_64-linux+guix-binary.tar.xz -O guix-binary-nightly.x86_64-linux.tar.xz
shell: bash
name: Download
- run: |
wget "https://savannah.gnu.org/people/viewgpg.php?user_id=127547" -qO - | sudo gpg --import -
wget "https://savannah.gnu.org/people/viewgpg.php?user_id=15145" -qO - | sudo gpg --import -
shell: bash
name: Fetch key
- run: |
export GUIX_BINARY_FILE_NAME=guix-binary-nightly.x86_64-linux.tar.xz
sudo --preserve-env=GUIX_BINARY_FILE_NAME -- bash -c 'yes | bash guix-install.sh'
sudo -- tar --extract --file "guix-binary-nightly.x86_64-linux.tar.xz" -C / --no-overwrite-dir
sudo -- groupadd --system guixbuild
for i in $(seq -w 1 10); do
sudo useradd -g guixbuild -G guixbuild -d /var/empty -s "$(which nologin)" -c "Guix build user $i" --system "guixbuilder${i}"
done
export GUIX_PATH=/var/guix/profiles/per-user/root/current-guix
sudo cp $GUIX_PATH/lib/systemd/system/{gnu-store.mount,guix-daemon.service} /etc/systemd/system/
sudo chmod 664 /etc/systemd/system/{gnu-store.mount,guix-daemon.service}
sudo systemctl daemon-reload
sudo systemctl enable --now gnu-store.mount guix-daemon.service
echo "$GUIX_PATH/bin" >> $GITHUB_PATH
shell: bash
name: Install Guix
- run: sudo -i guix archive --generate-key
- name: Authorize build farm
shell: bash
run: |
for F in /var/guix/profiles/per-user/root/current-guix/share/guix/*.pub; do
sudo /var/guix/profiles/per-user/root/current-guix/bin/guix archive --authorize < $F
done
- run: sudo /var/guix/profiles/per-user/root/current-guix/bin/guix archive --generate-key
shell: bash
name: Generate keys
- run: |
Expand All @@ -56,26 +69,13 @@ runs:
EOF
shell: bash
name: Create channel file
- run: guix pull --fallback -C ${{ runner.temp }}/channels.scm
- run: sudo /var/guix/profiles/per-user/root/current-guix/bin/guix pull --fallback -C ${{ runner.temp }}/channels.scm
shell: bash
name: Update Guix
if: ${{ inputs.pullAfterInstall == 'true' }}
# Use daemon from user, so we don’t have to `guix pull` twice.
- run: |
sudo sed -i "s/root/${USER}/" /etc/systemd/system/guix-daemon.service
sudo systemctl daemon-reload
sudo systemctl restart guix-daemon
shell: bash
name: Restart daemon
if: ${{ inputs.pullAfterInstall == 'true' }}
# Initially inherit root’s Guix profile, so we can use guix commands without sudo
- run: |
echo "$HOME/.config/guix/current/bin" >> $GITHUB_PATH
shell: bash
name: Set PATH
# Substitute newlines to work-around GitHubs single-line limitation.
- run: |
echo "channels=$(guix describe -f channels | tr '\n' ' ')" >> $GITHUB_OUTPUT
echo "channels=$(/var/guix/profiles/per-user/root/current-guix/bin/guix describe -f channels | tr '\n' ' ')" >> $GITHUB_OUTPUT
shell: bash
name: guix describe
id: guix-describe

0 comments on commit accc254

Please sign in to comment.