From 190fb8675890c4a3a528c8140ed49a4c592c8ea6 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Sun, 3 May 2026 14:24:03 +0200 Subject: [PATCH] feat(typing): possibly complete --- config.schema.json | 7 +++++-- config/dtype/__init__.py | 10 +++++++++- config/dtype/cmds.py | 4 ++-- config/dtype/git.py | 8 ++++++-- config/dtype/others.py | 12 ++++++++++++ config/dtype/pkgs.py | 2 +- 6 files changed, 35 insertions(+), 8 deletions(-) diff --git a/config.schema.json b/config.schema.json index c9ddf64..1596341 100644 --- a/config.schema.json +++ b/config.schema.json @@ -176,6 +176,10 @@ "type": "object", "description": "Settings for the bootloader, such as theme, using os-prober, etc", "properties": { + "managed": { + "type": "boolean", + "description": "Whether or not to manage the bootloader using archmgr" + }, "bootloader": { "type": "string", "description": "The bootloader to use (more coming eventually)", @@ -198,8 +202,7 @@ }, "additionalProperties": false, "required": [ - "bootloader", - "esp_dir" + "managed" ] }, "themes": { diff --git a/config/dtype/__init__.py b/config/dtype/__init__.py index 41cd83c..dd4f0de 100644 --- a/config/dtype/__init__.py +++ b/config/dtype/__init__.py @@ -1,9 +1,17 @@ from typing import TypedDict -from config.dtype.others import ArchMgrUserConfig +from config.dtype.cmds import ArchMgrCmdsConfig +from config.dtype.git import ArchMgrGitConfig +from config.dtype.others import ArchMgrBootConfig, ArchMgrSymlinkConfig, ArchMgrTemplateData, ArchMgrThemeConfig, ArchMgrUserConfig from config.dtype.pkgs import ArchMgrPkgConfig class ArchMgrConfig(TypedDict): pkgs: ArchMgrPkgConfig users: list[ArchMgrUserConfig] + boot: ArchMgrBootConfig + themes: ArchMgrThemeConfig + git: ArchMgrGitConfig + template_data: list[ArchMgrTemplateData] + symlinks: list[ArchMgrSymlinkConfig] + cmds: ArchMgrCmdsConfig diff --git a/config/dtype/cmds.py b/config/dtype/cmds.py index 6ee6959..9749b0a 100644 --- a/config/dtype/cmds.py +++ b/config/dtype/cmds.py @@ -2,8 +2,8 @@ from typing import Optional, TypedDict class ArchMgrCmdsConfig(TypedDict): - always: ArchMgrCommand - once: ArchMgrCommand + always: list[ArchMgrCommand] + once: list[ArchMgrCommand] class ArchMgrCommand(TypedDict): diff --git a/config/dtype/git.py b/config/dtype/git.py index b159f8f..6bfc63a 100644 --- a/config/dtype/git.py +++ b/config/dtype/git.py @@ -2,8 +2,12 @@ from typing import TypedDict class ArchMgrGitConfig(TypedDict): - creds: dict # TODO: - repos: dict # TODO + creds: ArchMgrGitCredsConfig + repos: list[ArchMgrGitRepoConfig] + + +class ArchMgrGitCredsConfig(TypedDict): + manager: str class ArchMgrGitRepoConfig(TypedDict): diff --git a/config/dtype/others.py b/config/dtype/others.py index 6e675b6..6d50790 100644 --- a/config/dtype/others.py +++ b/config/dtype/others.py @@ -5,9 +5,11 @@ class ArchMgrUserConfig(TypedDict): username: str groups: list[str] home_dir: bool + sudo_user: bool class ArchMgrBootConfig(TypedDict): + managed: bool bootloader: str esp_dir: str theme_folder: str @@ -20,3 +22,13 @@ class ArchMgrThemeConfig(TypedDict): font: str icon_theme: str cursor_theme: str + + +class ArchMgrTemplateData(TypedDict): + name: str + data: str + + +class ArchMgrSymlinkConfig(TypedDict): + destination: str + location: str diff --git a/config/dtype/pkgs.py b/config/dtype/pkgs.py index bd79227..66abd02 100644 --- a/config/dtype/pkgs.py +++ b/config/dtype/pkgs.py @@ -3,8 +3,8 @@ from typing import Optional, TypedDict class ArchMgrPkgConfig(TypedDict): individual: list[str] + repos: ArchMgrReposConfig bundles: list[ArchMgrBundleConfig] - repos: ArchMgrRepoSettings class ArchMgrReposConfig(TypedDict):