diff --git a/.github/workflows/nix-ci.yml b/.github/workflows/nix-ci.yml index c8929ae131..5ddf920d5d 100644 --- a/.github/workflows/nix-ci.yml +++ b/.github/workflows/nix-ci.yml @@ -36,12 +36,12 @@ jobs: with: extra_nix_config: | max-jobs = auto - extra-sandbox-paths = /var/cache/ccache + extra-sandbox-paths = /nix/var/cache/ccache - name: Cache uses: actions/cache@v2 with: - path: /var/cache/ccache key: ${{ matrix.name }}-build-${{ github.sha }} + path: /nix/var/cache/ccache # fall back to (latest) previous cache restore-keys: | ${{ matrix.name }}-build @@ -49,8 +49,6 @@ jobs: # can't use `nix-shell` yet since it will complain about the missing sandbox path shell: bash -euo pipefail {0} run: | - [ -d /var/cache/ccache ] || sudo mkdir -m0770 -p /var/cache/ccache - sudo chown -R root:nixbld /var/cache/ccache - name: Build run: nix build - name: Test diff --git a/flake.nix b/flake.nix index 3f5cc51428..acf2633551 100644 --- a/flake.nix +++ b/flake.nix @@ -22,7 +22,7 @@ bintools = llvmPackages_10.lldClang.bintools; }; extraConfig = '' - export CCACHE_DIR=/var/cache/ccache + export CCACHE_DIR=/nix/var/cache/ccache export CCACHE_UMASK=007 export CCACHE_BASE_DIR=$NIX_BUILD_TOP [ -d $CCACHE_DIR ] || exec ${cc}/bin/$(basename "$0") "$@"