From 14296ae720a97985eb35db35818d66c5ec75d63a Mon Sep 17 00:00:00 2001 From: Sebastian Ullrich Date: Sun, 3 Dec 2023 17:51:05 +0000 Subject: [PATCH] chore: Nix CI: update setup (#3015) Now that we're, at least temporarily, relying more on the Nix CI, replace some old hacks of mine with better solutions people have figured out in the meantime. Cachix support could probably be dropped at this point but it doesn't really hurt. --- .github/workflows/nix-ci.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/nix-ci.yml b/.github/workflows/nix-ci.yml index c18922c922..a6aa76588f 100644 --- a/.github/workflows/nix-ci.yml +++ b/.github/workflows/nix-ci.yml @@ -17,7 +17,7 @@ jobs: runs-on: ${{ matrix.os }} defaults: run: - shell: nix -v --experimental-features "nix-command flakes" run .#ciShell -- bash -euxo pipefail {0} + shell: nix run .#ciShell -- bash -euxo pipefail {0} strategy: matrix: include: @@ -29,21 +29,13 @@ jobs: fail-fast: false name: ${{ matrix.name }} env: - NIX_BUILD_ARGS: -v --print-build-logs --fallback + NIX_BUILD_ARGS: --print-build-logs --fallback steps: - name: Checkout uses: actions/checkout@v3 with: # the default is to use a virtual merge commit between the PR and master: just use the PR ref: ${{ github.event.pull_request.head.sha }} - - name: Install Nix - uses: cachix/install-nix-action@v18 - with: - # https://github.com/NixOS/nix/issues/6572 - install_url: https://releases.nixos.org/nix/nix-2.7.0/install - extra_nix_config: | - extra-sandbox-paths = /nix/var/cache/ccache - substituters = file://${{ github.workspace }}/nix-store-cache-copy?priority=10&trusted=true https://cache.nixos.org - name: Set Up Nix Cache uses: actions/cache@v3 with: @@ -57,8 +49,13 @@ jobs: run: | # Nix seems to mutate the cache, so make a copy cp -r nix-store-cache nix-store-cache-copy || true + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + extra-sandbox-paths = /nix/var/cache/ccache? + substituters = file://${{ github.workspace }}/nix-store-cache-copy?priority=10&trusted=true https://cache.nixos.org - name: Prepare CCache Cache - shell: bash -euxo pipefail {0} run: | sudo mkdir -m0770 -p /nix/var/cache/ccache sudo chown -R $USER /nix/var/cache/ccache @@ -71,7 +68,6 @@ jobs: restore-keys: | ${{ matrix.name }}-nix-ccache - name: Further Set Up CCache Cache - shell: bash -euxo pipefail {0} run: | sudo chown -R root:nixbld /nix/var/cache sudo chmod -R 770 /nix/var/cache