@@ -131,6 +131,10 @@ jobs:
131131 runs-on : ubuntu-latest
132132
133133 env :
134+ NIXPKGS_CHANNEL : nixos-25.05
135+ NIX_EXTRA_CONFIG : |
136+ keep-env-derivations = true
137+ keep-outputs = true
134138 NIX_EXTRA_CONFIG_ACT : |
135139 sandbox = false
136140 filter-syscalls = false
@@ -145,14 +149,35 @@ jobs:
145149 steps :
146150 - uses : actions/checkout@v5
147151
152+ - name : Determine CI configuration
153+ id : config
154+ env :
155+ CI_CONFIG : ci/configs/${{ matrix.config }}.bash
156+ run : ci/scripts/config.sh
157+
148158 - name : Install Nix
149159 uses : cachix/install-nix-action@v31 # 2025-05-27, from https://github.com/cachix/install-nix-action/tags
150160 with :
151- nix_path : nixpkgs=channel:nixos-25.05 # latest release
161+ nix_path : nixpkgs=https://github.com/NixOS/nixpkgs/archive/${{ steps.config.outputs.nixpkgs_rev }}.tar.gz
152162 # Act executes inside an unprivileged container (Docker or Podman),
153163 # so KVM support isn't available.
154164 enable_kvm : " ${{ github.actor != 'nektos/act' }}"
155- extra_nix_config : ${{ github.actor == 'nektos/act' && env.NIX_EXTRA_CONFIG_ACT || '' }}
165+ extra_nix_config : |
166+ ${{ env.NIX_EXTRA_CONFIG }}
167+ ${{ github.actor == 'nektos/act' && env.NIX_EXTRA_CONFIG_ACT || '' }}
168+
169+ # Cache the heaviest Nix job to stay within GitHub's cache budget while
170+ # still avoiding repeated gnu32 cross-toolchain downloads and builds.
171+ - name : Cache Nix store
172+ if : steps.config.outputs.cache_nix_store == 'true'
173+ uses : nix-community/cache-nix-action@v7
174+ with :
175+ primary-key : nix-${{ runner.os }}-${{ matrix.config }}-${{ steps.config.outputs.nixpkgs_rev }}-${{ hashFiles('shell.nix', 'ci/patches/*.patch', format('ci/configs/{0}.bash', matrix.config)) }}
176+ restore-prefixes-first-match : |
177+ nix-${{ runner.os }}-${{ matrix.config }}-${{ steps.config.outputs.nixpkgs_rev }}-
178+ nix-${{ runner.os }}-${{ matrix.config }}-
179+ nix-${{ runner.os }}-
180+ gc-max-store-size-linux : 10G
156181
157182 - name : Run CI script
158183 env :
0 commit comments