Skip to content

Commit

Permalink
use DeterminateSystems nix installer
Browse files Browse the repository at this point in the history
  • Loading branch information
LucilleH committed Sep 19, 2023
1 parent 73c22b3 commit efe9b42
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,43 +91,43 @@ runs:
fi
sudo mv "$DEVBOX_BINARY" /usr/local/bin/devbox
- name: Configure nix access-tokens
if: inputs.disable-nix-access-token == 'false'
shell: bash
run: |
mkdir -p ~/.config/nix
echo "access-tokens = github.com=${{ github.token }}" >> ~/.config/nix/nix.conf
- name: Devbox setup Nix
shell: bash
run: |
export NIX_USER_COUNT=1
export NIX_INSTALLER_NO_CHANNEL_ADD=1
export NIX_BUILD_SHELL=/bin/bash
devbox setup nix
- name: Workaround nix store cache permission issue
if: inputs.enable-cache == 'true'
shell: bash
run: |
whoami
ls -al /nix/store
if [ "$RUNNER_OS" == "macOS" ]; then
sudo /usr/sbin/dseditgroup -o edit -t user \
-a "$(whoami)" "nixbld"
sudo mv /usr/local/bin/gtar /usr/local/bin/gtar.orig
echo "#!/bin/sh" >> /usr/local/bin/gtar
echo "set -euo pipefail" >> /usr/local/bin/gtar
echo 'exec sudo /usr/local/bin/gtar.orig "$@"' >> /usr/local/bin/gtar
sudo chmod +x /usr/local/bin/gtar
else
sudo chmod u+s "$(command -v tar)"
fi
- name: Configure nix access-tokens
if: inputs.disable-nix-access-token == 'false'
shell: bash
run: |
mkdir -p ~/.config/nix
echo "access-tokens = github.com=${{ github.token }}" >> ~/.config/nix/nix.conf
- name: Install nix
uses: DeterminateSystems/nix-installer-action@v4
with:
logger: pretty
extra-conf: experimental-features = ca-derivations fetch-closure

- name: Mount nix store cache
if: inputs.enable-cache == 'true'
uses: actions/cache@v3
with:
path: |
~/.local/state/nix
~/.nix-defexpr
~/.nix-profile
/nix/store
~/.local/state/nix
/nix/var/nix
key: ${{ runner.os }}-devbox-${{ hashFiles(format('{0}/devbox.lock', inputs.project-path)) }}

- name: Install devbox packages
Expand Down

0 comments on commit efe9b42

Please sign in to comment.