Inventory/schemas: move all schemas to legacyPackages
This commit is contained in:
@@ -25,20 +25,6 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
packages.inventory-schema-abstract = pkgs.stdenv.mkDerivation {
|
||||
name = "inventory-schema";
|
||||
buildInputs = [ pkgs.cue ];
|
||||
src = ./.;
|
||||
buildPhase = ''
|
||||
export SCHEMA=${builtins.toFile "inventory-schema.json" (builtins.toJSON self'.legacyPackages.schemas.inventory)}
|
||||
cp $SCHEMA schema.json
|
||||
cue import -f -p compose -l '#Root:' schema.json
|
||||
mkdir $out
|
||||
cp schema.cue $out
|
||||
cp schema.json $out
|
||||
'';
|
||||
};
|
||||
|
||||
legacyPackages.schemas = (
|
||||
import ./schemas {
|
||||
inherit
|
||||
|
||||
@@ -30,10 +30,31 @@ let
|
||||
"E501"
|
||||
];
|
||||
} ./render_schema.py;
|
||||
|
||||
inventory-schema-abstract = pkgs.stdenv.mkDerivation {
|
||||
name = "inventory-schema-files";
|
||||
buildInputs = [ pkgs.cue ];
|
||||
src = ./.;
|
||||
buildPhase = ''
|
||||
export SCHEMA=${builtins.toFile "inventory-schema.json" (builtins.toJSON inventorySchema)}
|
||||
cp $SCHEMA schema.json
|
||||
# Also generate a CUE schema version that is derived from the JSON schema
|
||||
cue import -f -p compose -l '#Root:' schema.json
|
||||
mkdir $out
|
||||
cp schema.cue $out
|
||||
cp schema.json $out
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit inventorySchema modulesSchema renderSchema;
|
||||
inherit
|
||||
inventorySchema
|
||||
modulesSchema
|
||||
renderSchema
|
||||
inventory-schema-abstract
|
||||
;
|
||||
|
||||
# Inventory schema, with the modules schema added per role
|
||||
inventory =
|
||||
pkgs.runCommand "rendered"
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user