feat: Start config schema

This commit is contained in:
2026-04-17 15:41:07 +02:00
parent 4017e0263b
commit bcd0339d88
5 changed files with 127 additions and 2 deletions
+3 -2
View File
@@ -17,5 +17,6 @@ def commit(force: bool = False, no_render: bool = False):
# Probably do that check in the pacman util lib tho
add, remove = pkg_diff([], pacman.list_explicitly_installed())
print_diff(add, remove)
if confirm(True, "Do you really want to proceed?"):
pw = password()
if confirm(False, "Do you really want to proceed?"):
pacman.install_package_list(add)
pacman.uninstall_package_list(remove)
+68
View File
@@ -0,0 +1,68 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"type": "object",
"properties": {
"requires": {
"type": "array",
"items": {
"type": "string",
"pattern": "^([a-zA-Z0-9.-_]+\/)+",
"description": "Path to other configs, relative to this file (e.g. config/pkgs.yaml will expand to dirname(this_file)/config/pkgs.yaml)"
},
"description": "Imports for other config files that will be merged into this one. Precedence order is bottom up (i.e. lowest has highest precedence)"
},
"pkgs": {
"type": "object",
"description": "The packages to be installed",
"properties": {
"individual": {
"type:": "array",
"description": "the packages to be installed, by their package name",
"items": {
"type": "string"
}
},
"presets": {
"type": "array",
"maxItems": 1,
"items": {
"type": "string"
}
}
}
},
"users": {
"type": "array",
"properties": {}
},
"boot": {
"type": "object",
"properties": {}
},
"themes": {
"type": "object",
"properties": {}
},
"git": {
"type": "object",
"properties": {}
},
"template_data": {
"type": "array",
"items": {}
},
"cmds": {
"type": "array",
"description": "Commands to run on first install",
"items": {
"type": "string"
}
},
"additionalProperties": false
},
"required": [
"pkgs",
"boot"
],
"additionalProperties": false
}
+54
View File
@@ -0,0 +1,54 @@
# yaml-language-server: $schema=config.schema.json
# TODO: Change the above to an import URL instead
requires:
- path/to/other/configs/relative/to/this # Reads the other configs after finishing this one
pkgs:
named:
- pkg_name
presets:
- hyprland
users:
- username: username
groups:
- group_1
home_dir: True
boot:
bootloader: grub
theme:
src: git # (expects a git clone url) or repo (for this repo) or url (for a valid URL openable using wget)
url: path/to/theme
build: none # or make TODO: More options
os_prober: False
# Also copies over the /etc/default/grub config or equivalent for other supported bootloaders
# TODO: Desktops, login managers, full disk encryption etc configuration?
themes:
gtk: theme_name
qt: theme_name # or use_gtk to use the gtk theme instaed
font: Comfortaa 11 # the font name to be used (also needs to be installed)
icon_theme: candy-icons # The icon theme to use (also needs to be installed)
cursor_theme: oreo_spark_blue_cursors # TODO: Consider if GTK settings file should just be copied
git:
creds:
ssh_cert: gen # or none
manager: git-credential-manager # or none
login:
- service: github # Service name
type: oauth # Set to ssh for it to not be managed by cred manager
url: https://github.com
repos:
- url: https://github.com/...
clone_path: ~/projects/ # Project location will be clone_path/<repo name>
template_data:
- name: template_data_name
data: the_data
# TODO: Think about how to handle this appropriately with diffing and stuff
cmds:
- "command to run"
View File
+2
View File
@@ -0,0 +1,2 @@
def validate():
pass