# Pastebin v5KSs9xQ with import { }; let failures = lib.runTests { testAdd = { expr = 2 + 2; expected = 2; }; testSub = { expr = 1 - 1; expected = 0; }; }; in stdenv.mkDerivation { name = "test-results"; runCommand = if builtins.length failures > 0 then "exit 1" else "echo 'OK' > $out"; }