ci: check flake outputs per-output to skip the OOM-heavy package
Some checks failed
Check / eval-and-lint (push) Failing after 3h0m3s

`nix flake check --no-build` also evaluates packages.allThemeVariants, a
linkFarm whose drvPath forces all 22 home generations into memory at once
— the runner OOM-killed there ("Killed" after allThemeVariants). Replace
it with an explicit per-output eval that forces all 4 system closures
(incl. assertions), both standalone home generations, the installer VM
package, the overlay and the app, and skips only allThemeVariants/default.
Each tryEval is GC'd before the next, so peak memory is one config rather
than twenty-two. The eval matrix already validates every palette
one-at-a-time, so dropping that package from CI loses no real coverage.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Bernardo Magri
2026-05-29 22:51:05 +01:00
parent 6c66db9b88
commit 2dda8e2bb5

View File

@@ -2,6 +2,9 @@
#
# Catches the regressions that hurt today:
# 1. Flake stops evaluating (broken option ref, missing import, etc.).
# Checked per-output rather than via `nix flake check` so we can skip
# packages.allThemeVariants — the 22-generation linkFarm that OOMs the
# runner; every palette is validated one-at-a-time by the matrix (4).
# 2. A `nomarchy-*` shell script has a syntax error or a shellcheck
# error-severity issue.
# 3. `docs/SCRIPTS.md` drifts from the repo state because somebody
@@ -84,8 +87,36 @@ jobs:
run: |
nix build --no-link --impure --expr 'let f = builtins.getFlake (toString ./.); in f.inputs.walker.packages.${builtins.currentSystem}.default.src'
- name: nix flake check --no-build
run: nix flake check --no-build
- name: Check flake outputs (except the 22-variant pre-cache package)
# Stand-in for `nix flake check --no-build`. That also evaluates
# packages.allThemeVariants — a linkFarm whose drvPath forces all 22
# home generations into memory at once, OOM-killing the runner. The
# eval matrix below already validates every palette one-at-a-time, so
# that package's CI value is near-zero. Here we force every other
# output (all 4 system closures incl. assertions, both standalone
# home generations, the installer VM package, the overlay, the app)
# and skip only allThemeVariants/default. Each tryEval is GC'd before
# the next, so peak memory is one config, not twenty-two.
run: |
nix eval --impure --raw --expr 'let
f = builtins.getFlake (toString ./.);
lib = f.inputs.nixpkgs.lib;
sys = "x86_64-linux";
ok = x: (builtins.tryEval (builtins.seq x true)).success;
checks = {
"nixos.default" = ok f.nixosConfigurations.default.config.system.build.toplevel.drvPath;
"nixos.nomarchy-installer" = ok f.nixosConfigurations.nomarchy-installer.config.system.build.toplevel.drvPath;
"nixos.installerVm" = ok f.nixosConfigurations.installerVm.config.system.build.toplevel.drvPath;
"nixos.nomarchy-live" = ok f.nixosConfigurations.nomarchy-live.config.system.build.toplevel.drvPath;
"home.nomarchy" = ok f.homeConfigurations.nomarchy.activationPackage.drvPath;
"home.nixos" = ok f.homeConfigurations.nixos.activationPackage.drvPath;
"packages.installerVm" = ok f.packages.${sys}.installerVm.drvPath;
"overlays.default" = ok (builtins.isFunction f.overlays.default);
"apps.installerVm" = ok f.apps.${sys}.installerVm.program;
};
failed = builtins.attrNames (lib.filterAttrs (_: v: !v) checks);
in if failed == [] then "ALL OK"
else throw ("flake-output checks failed: " + builtins.concatStringsSep ", " failed)'
- name: Evaluate opt-in toggle / palette / home matrix
# flake check never flips a nomarchy.* toggle; this does. jq is