clan/checks: move into lib function; add tests

This commit is contained in:
Johannes Kirschbauer
2025-10-28 09:40:31 +01:00
parent b3323007b2
commit 0060ead876
6 changed files with 83 additions and 25 deletions

View File

@@ -56,15 +56,8 @@ in
}
];
};
apply =
config:
lib.deepSeq (lib.mapAttrs (
id: check:
if check.ignore || check.assertion then
null
else
throw "clan.checks.${id} failed with message\n${check.message}"
) config.checks) config;
# Important: !This logic needs to be kept in sync with lib.clan function!
apply = config: clan-core.lib.checkConfig config.checks config;
};
# Mapped flake toplevel outputs