Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
636 B
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
lib,
newScope,
json-schema-catalog-rs,
jsonschema-cli,
}:
let
inherit (lib) concatMapAttrs optionalAttrs;
inherit (lib.strings) hasSuffix removeSuffix;
jsonSchemaCatalogs = lib.makeScope newScope (
self:
{
inherit ((self.callPackage ./lib.nix { }).lib) newCatalog;
tests = self.callPackage ./tests.nix { };
}
// concatMapAttrs (
k: v:
optionalAttrs (v == "regular" && hasSuffix ".nix" k) {
${removeSuffix ".nix" k} = self.callPackage (./catalogs + "/${k}") { };
}
) (builtins.readDir ./catalogs)
);
in
{
# Exported to `pkgs`
inherit jsonSchemaCatalogs;
}