fix(flake): make the eval-tests check a derivation

checks.<system>.eval-tests returned a boolean, so nix flake check failed with "not a derivation". Wrap the evalTests result in a runCommand so flake check actually evaluates it.
This commit is contained in:
Ryan Yin
2026-09-19 12:11:03 +08:00
parent f8d12ada24
commit ff961c1bc9
+13 -2
View File
@@ -154,8 +154,19 @@ in
evalTests = lib.lists.all (it: it.evalTests == { }) allSystemValues;
checks = forAllSystems (system: {
# eval-tests per system
eval-tests = allSystems.${system}.evalTests == { };
# eval-tests per system. `nix flake check` requires every check to be a
# derivation, so wrap the boolean result in one instead of returning a bool.
eval-tests =
let
pkgs = nixpkgs.legacyPackages.${system};
results = allSystems.${system}.evalTests;
in
pkgs.runCommand "eval-tests" { } (
if results == { } then
"touch $out"
else
"echo 'eval tests failed: evalTests is not empty' >&2; exit 1"
);
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = mylib.relativeToRoot ".";