2023-08-09 14:05:16 +00:00
|
|
|
{
|
2024-03-17 18:48:49 +00:00
|
|
|
perSystem =
|
|
|
|
{ pkgs, ... }:
|
|
|
|
{
|
|
|
|
checks = {
|
2023-08-09 14:05:16 +00:00
|
|
|
|
2024-03-17 18:48:49 +00:00
|
|
|
# check if the `clan config` example jsonschema and data is valid
|
|
|
|
lib-jsonschema-example-valid = pkgs.runCommand "lib-jsonschema-example-valid" { } ''
|
|
|
|
echo "Checking that example-schema.json is valid"
|
|
|
|
${pkgs.check-jsonschema}/bin/check-jsonschema \
|
|
|
|
--check-metaschema ${./.}/example-schema.json
|
2023-08-09 14:05:16 +00:00
|
|
|
|
2024-03-17 18:48:49 +00:00
|
|
|
echo "Checking that example-data.json is valid according to example-schema.json"
|
|
|
|
${pkgs.check-jsonschema}/bin/check-jsonschema \
|
|
|
|
--schemafile ${./.}/example-schema.json \
|
|
|
|
${./.}/example-data.json
|
2023-08-09 14:05:16 +00:00
|
|
|
|
2024-03-17 18:48:49 +00:00
|
|
|
touch $out
|
|
|
|
'';
|
2023-08-09 14:05:16 +00:00
|
|
|
|
2024-03-17 18:48:49 +00:00
|
|
|
# check if the `clan config` nix jsonschema converter unit tests succeed
|
|
|
|
lib-jsonschema-nix-unit-tests = pkgs.runCommand "lib-jsonschema-nix-unit-tests" { } ''
|
|
|
|
export NIX_PATH=nixpkgs=${pkgs.path}
|
|
|
|
${pkgs.nix-unit}/bin/nix-unit \
|
|
|
|
${./.}/test.nix \
|
|
|
|
--eval-store $(realpath .)
|
|
|
|
touch $out
|
|
|
|
'';
|
|
|
|
};
|
2023-08-09 14:05:16 +00:00
|
|
|
};
|
|
|
|
}
|