diff --git a/.github/actions/setup-nix/action.yml b/.github/actions/setup-nix/action.yml index d705a5b69..c1c3e5bf1 100644 --- a/.github/actions/setup-nix/action.yml +++ b/.github/actions/setup-nix/action.yml @@ -9,6 +9,12 @@ runs: - name: Install nix uses: DeterminateSystems/determinate-nix-action@main - name: Use nix cache - uses: DeterminateSystems/magic-nix-cache-action@main + uses: nix-community/cache-nix-action@v7 with: - use-flakehub: false + primary-key: nix-${{ runner.os }}-${{ github.job }}-${{ hashFiles('flake.nix', 'flake.lock') }} + restore-prefixes-first-match: nix-${{ runner.os }}-${{ github.job }}- + gc-max-store-size: 1G + purge: true + purge-prefixes: nix-${{ runner.os }}-${{ github.job }}- + purge-created: 0 + purge-primary-key: never diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 3cd50ce6d..e9dde3148 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -27,12 +27,8 @@ jobs: # The toolchain must be specified manually, as this action ignores the rust-toolchain override # https://github.com/dtolnay/rust-toolchain?tab=readme-ov-file#inputs toolchain: ${{ matrix.rust }} - - name: "Install nix" - uses: DeterminateSystems/determinate-nix-action@main - - name: "Use nix cache" - uses: DeterminateSystems/magic-nix-cache-action@main - with: - use-flakehub: false + - name: Set up nix + uses: ./.github/actions/setup-nix - name: "Add nginxWithStream to PATH" run: | # This is necessary for payjoin-mailroom integration tests @@ -49,12 +45,8 @@ jobs: uses: actions/checkout@v6 - name: "Use cache" uses: Swatinem/rust-cache@v2 - - name: "Install nix" - uses: DeterminateSystems/determinate-nix-action@main - - name: "Use nix cache" - uses: DeterminateSystems/magic-nix-cache-action@main - with: - use-flakehub: false + - name: Set up nix + uses: ./.github/actions/setup-nix - name: "Run code linting" run: nix develop -c ./contrib/lint.sh - name: "Run documentation linting" @@ -77,12 +69,8 @@ jobs: - name: "Install toolchain" # rust-cache usage with stable Rust is most effective, as a cache is tied to the Rust version uses: dtolnay/rust-toolchain@stable - - name: "Install nix" - uses: DeterminateSystems/determinate-nix-action@main - - name: "Use nix cache" - uses: DeterminateSystems/magic-nix-cache-action@main - with: - use-flakehub: false + - name: Set up nix + uses: ./.github/actions/setup-nix - name: "Add nginxWithStream to PATH" run: | # This is necessary for payjoin-mailroom integration tests