diff --git a/.forgejo/install-emacs/action.yml b/.forgejo/install-emacs/action.yml index f27e80d..6fe1a2b 100644 --- a/.forgejo/install-emacs/action.yml +++ b/.forgejo/install-emacs/action.yml @@ -7,7 +7,21 @@ inputs: runs: using: 'composite' steps: + - name: Restore cached version + id: cache-restore + uses: https://code.forgejo.org/actions/cache/restore@v4 + with: + path: | + /nix/store + key: ${{ inputs.version }}-${{ hashFiles('flake.lock') }} - run: ${{ github.action_path }}/install.sh shell: bash env: INPUT_VERSION: ${{ inputs.version }} + - name: Cache version + id: cache-put + uses: https://code.forgejo.org/actions/cache/save@v4 + with: + path: | + /nix/store + key: ${{ inputs.version }}-${{ hashFiles('flake.lock') }} diff --git a/.forgejo/install-emacs/install-nix.sh b/.forgejo/install-emacs/install-nix.sh index 6af4388..75c0177 100755 --- a/.forgejo/install-emacs/install-nix.sh +++ b/.forgejo/install-emacs/install-nix.sh @@ -1,6 +1,10 @@ #!/usr/bin/env bash set -euo pipefail +# Sudo is required by this installer +apt-get update -qq +apt-get install -y sudo + if nix_path="$(type -p nix)" ; then echo "Aborting: Nix is already installed at ${nix_path}" exit @@ -79,8 +83,6 @@ else # "fix" the following error when running nix* # error: the group 'nixbld' specified in 'build-users-group' does not exist add_config "build-users-group =" - apt-get update -qq - apt-get install -y sudo sudo mkdir -p /etc/nix sudo chmod 0755 /etc/nix sudo cp "$workdir/nix.conf" /etc/nix/nix.conf