CLI: use abstract schema to avoid module imports

This commit is contained in:
Johannes Kirschbauer
2024-09-15 18:42:19 +02:00
parent 4b1a9afc37
commit 8bda488425
4 changed files with 18 additions and 5 deletions

View File

@@ -84,6 +84,19 @@ in
cp schema.json $out
'';
};
packages.inventory-schema-abstract = pkgs.stdenv.mkDerivation {
name = "inventory-schema";
buildInputs = [ pkgs.cue ];
src = ./.;
buildPhase = ''
export SCHEMA=${builtins.toFile "inventory-schema.json" (builtins.toJSON bareSchema.abstractSchema)}
cp $SCHEMA schema.json
cue import -f -p compose -l '#Root:' schema.json
mkdir $out
cp schema.cue $out
cp schema.json $out
'';
};
packages.inventory-schema-pretty = pkgs.stdenv.mkDerivation {
name = "inventory-schema-pretty";
buildInputs = [ pkgs.cue ];