Cache nix
This commit is contained in:
parent
d9347fcc22
commit
6db71f77c3
2 changed files with 18 additions and 2 deletions
|
|
@ -7,7 +7,21 @@ inputs:
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: 'composite'
|
||||||
steps:
|
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
|
- run: ${{ github.action_path }}/install.sh
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
INPUT_VERSION: ${{ inputs.version }}
|
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') }}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
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
|
if nix_path="$(type -p nix)" ; then
|
||||||
echo "Aborting: Nix is already installed at ${nix_path}"
|
echo "Aborting: Nix is already installed at ${nix_path}"
|
||||||
exit
|
exit
|
||||||
|
|
@ -79,8 +83,6 @@ else
|
||||||
# "fix" the following error when running nix*
|
# "fix" the following error when running nix*
|
||||||
# error: the group 'nixbld' specified in 'build-users-group' does not exist
|
# error: the group 'nixbld' specified in 'build-users-group' does not exist
|
||||||
add_config "build-users-group ="
|
add_config "build-users-group ="
|
||||||
apt-get update -qq
|
|
||||||
apt-get install -y sudo
|
|
||||||
sudo mkdir -p /etc/nix
|
sudo mkdir -p /etc/nix
|
||||||
sudo chmod 0755 /etc/nix
|
sudo chmod 0755 /etc/nix
|
||||||
sudo cp "$workdir/nix.conf" /etc/nix/nix.conf
|
sudo cp "$workdir/nix.conf" /etc/nix/nix.conf
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue