refactor: store module schemas in their own subdirectory, add a few more modules
This commit is contained in:
parent
2fa5fecc7c
commit
6e6ccccb6c
6 changed files with 49 additions and 21 deletions
|
|
@ -3,11 +3,11 @@ import "./modules.tsp";
|
|||
|
||||
using TypeSpec.JsonSchema;
|
||||
|
||||
@jsonSchema()
|
||||
@jsonSchema("recipe.json")
|
||||
model recipe {
|
||||
name: string,
|
||||
description: string,
|
||||
"base-image": string,
|
||||
"image-version": string,
|
||||
modules: Array<module>
|
||||
modules: Array<Module>
|
||||
}
|
||||
|
|
@ -1,21 +1,12 @@
|
|||
import "@typespec/json-schema";
|
||||
using TypeSpec.JsonSchema;
|
||||
import "./modules/akmods.tsp";
|
||||
import "./modules/bling.tsp";
|
||||
import "./modules/fonts.tsp";
|
||||
import "./modules/rpm-ostree.tsp";
|
||||
|
||||
alias module = rpmOstreeModule | fontsModule;
|
||||
alias Module =
|
||||
akmodsModule |
|
||||
blingModule |
|
||||
fontsModule |
|
||||
rpmOstreeModule
|
||||
;
|
||||
|
||||
@jsonSchema("/modules/rpm-ostree.json")
|
||||
model rpmOstreeModule {
|
||||
type: "rpm-ostree",
|
||||
repos: Array<string>,
|
||||
install: Array<string>,
|
||||
remove: Array<string>,
|
||||
}
|
||||
|
||||
@jsonSchema("/modules/fonts.json")
|
||||
model fontsModule {
|
||||
type: "fonts",
|
||||
fonts: {
|
||||
"nerd-fonts": Array<string>,
|
||||
"google-fonts": Array<string>
|
||||
}
|
||||
}
|
||||
9
src-tsp/modules/akmods.tsp
Normal file
9
src-tsp/modules/akmods.tsp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import "@typespec/json-schema";
|
||||
using TypeSpec.JsonSchema;
|
||||
|
||||
@jsonSchema("/modules/akmods.json")
|
||||
model akmodsModule {
|
||||
type: "akmods",
|
||||
base: "main" | "asus" | "fsync" | "surface",
|
||||
install: Array<string>
|
||||
}
|
||||
7
src-tsp/modules/bling.tsp
Normal file
7
src-tsp/modules/bling.tsp
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import "@typespec/json-schema";
|
||||
using TypeSpec.JsonSchema;
|
||||
|
||||
@jsonSchema("/modules/bling.json")
|
||||
model blingModule {
|
||||
install: "ublue-update" | "1password" | "dconf-update-service" | "gnome-vrr" | "laptop" | "flatpaksync"
|
||||
}
|
||||
11
src-tsp/modules/fonts.tsp
Normal file
11
src-tsp/modules/fonts.tsp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import "@typespec/json-schema";
|
||||
using TypeSpec.JsonSchema;
|
||||
|
||||
@jsonSchema("/modules/fonts.json")
|
||||
model fontsModule {
|
||||
type: "fonts",
|
||||
fonts: {
|
||||
"nerd-fonts": Array<string>,
|
||||
"google-fonts": Array<string>
|
||||
}
|
||||
}
|
||||
10
src-tsp/modules/rpm-ostree.tsp
Normal file
10
src-tsp/modules/rpm-ostree.tsp
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import "@typespec/json-schema";
|
||||
using TypeSpec.JsonSchema;
|
||||
|
||||
@jsonSchema("/modules/rpm-ostree.json")
|
||||
model rpmOstreeModule {
|
||||
type: "rpm-ostree",
|
||||
repos: Array<string>,
|
||||
install: Array<string>,
|
||||
remove: Array<string>,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue