From ff961c1bc900afe832f1a4f98c1f410a09a3a2d0 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sat, 19 Sep 2026 12:11:03 +0800 Subject: [PATCH] fix(flake): make the eval-tests check a derivation checks..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. --- outputs/default.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/outputs/default.nix b/outputs/default.nix index 6f8404c1..4b66723b 100644 --- a/outputs/default.nix +++ b/outputs/default.nix @@ -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 ".";