ci/nix: Allow IFD for runtime dependency replacements
Update docs / update (push) Successful in 1m5s
CI / Check, build and cache nixfiles (push) Failing after 1h2m10s

Share a single replacement list between NixOS and standalone Home
Manager. CI checks that list against its targets' nixpkgs channels.

When a replacement applies, warn and defer the flake check until
after the target builds. Runtime replacement needs to generate and
import store reference graphs during evaluation, which fails under
`nix flake check --no-build` on a fresh runner.

Keep the early eval-only check and disable IFD when the list is empty.
This commit is contained in:
jackos1998 committed 2026-11-23 23:45:23 +00:00
1 parent d5e2b93fd0
commit fabbb43fbf
8 files changed
+68 -22

No files matched your search

+10 -3
View File
@@ -296,13 +296,20 @@ GitHub/Gitea Actions workflows live in [`.gitea/workflows/`](../.gitea/workflows
On pushes to `master`, this installs Determinate Nix on the runner (via
`DeterminateSystems/determinate-nix-action`, configured with the same performance settings and
Harmonia substituter as the boxes), runs `nix flake check --no-build`, then builds every attribute
of `.#ci.x86_64-linux`: systems as `system-<name>`, homes as `home-<name>` (with `@` changed to
`-at-`), packages as `package-<name>`, and the development `shell`. Each result is pushed to the
Harmonia substituter as the boxes). CI normally runs `nix flake check --no-build` first and
keeps import from derivation disabled. It builds every attribute of `.#ci.x86_64-linux`:
systems as `system-<name>`, homes as `home-<name>` (with `@` changed to `-at-`), packages as
`package-<name>`, and the development `shell`. Each result is pushed to the
Harmonia cache with [`ci/push-to-cache.sh`](../ci/push-to-cache.sh). Before the first push, the
workflow deletes cache-profile generations older than its retention period, then collects
unreachable paths so a full cache cannot prevent collection from being reached.
When `.#ciIfdReasons.x86_64-linux` lists an active exception, CI logs a warning with the reason
and allows import from derivation for the target builds. It runs a build-capable flake
check afterward. CI checks [the shared runtime replacement list](../lib/runtime-dependency-replacements.nix)
against the nixpkgs channels used by its systems and standalone homes. A matching entry
requires reading generated store reference graphs during evaluation.
It then builds `.#ciDrv.x86_64-linux`, a `linkFarm` of all CI attributes, and pushes it with
`UPDATE_PROFILE=1`. That updates the `nixfiles` profile on the cache box. The SSH store uses
`/var/lib/harmonia`, `HARMONIA_SSH_KEY`, and pinned `ci/known_hosts`; clients use
+3 -2
View File
@@ -43,7 +43,7 @@ against the candidate revisions and leave a concrete next step for any outstandi
- `home-manager-stable.url = "home-manager/release-<STABLE>"`
- **Devshell commands:** `update-nixpkgs` = `nix flake update nixpkgs-{unstable,stable,mine,mine-stable}`;
`update-home-manager` = `nix flake update home-manager-{unstable,stable}`.
- **Validation:** prefer `check-system <host>` and `nix flake check --no-build` over full builds.
- **Validation:** prefer `check-system <host>` while iterating and reserve the flake check for final validation.
## Phase 1 — Determine the current NixOS stable
@@ -188,7 +188,8 @@ Don't blanket-update. Walk the other inputs deliberately:
## Phase 7 — Validate
1. `nix flake check --no-build` (broad eval; reproduces CI's cheap checks).
1. `nix flake check --no-build` for broad validation. If `.#ciIfdReasons.x86_64-linux` lists
an active exception, use `nix flake check` so evaluation can build the required inputs.
2. `check-system <host>` on a representative box, and one exercising the stable channel if the
boxes mix channels. This must exercise the refreshed kernel constants on both channels.
3. Build the actual devshell with