feat(config): Config loading and merging
This commit is contained in:
@@ -1,17 +1,23 @@
|
||||
from typing import TypedDict
|
||||
from typing import Optional, TypedDict
|
||||
|
||||
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.others import (
|
||||
ArchMgrBootConfig,
|
||||
ArchMgrSymlinkConfig,
|
||||
ArchMgrTemplateData,
|
||||
ArchMgrThemeConfig,
|
||||
ArchMgrUserConfig,
|
||||
)
|
||||
from config.dtype.pkgs import ArchMgrPkgConfig
|
||||
|
||||
|
||||
class ArchMgrConfig(TypedDict):
|
||||
pkgs: ArchMgrPkgConfig
|
||||
users: list[ArchMgrUserConfig]
|
||||
users: Optional[list[ArchMgrUserConfig]]
|
||||
boot: ArchMgrBootConfig
|
||||
themes: ArchMgrThemeConfig
|
||||
git: ArchMgrGitConfig
|
||||
template_data: list[ArchMgrTemplateData]
|
||||
symlinks: list[ArchMgrSymlinkConfig]
|
||||
cmds: ArchMgrCmdsConfig
|
||||
themes: Optional[ArchMgrThemeConfig]
|
||||
git: Optional[ArchMgrGitConfig]
|
||||
template_data: Optional[list[ArchMgrTemplateData]]
|
||||
symlinks: Optional[list[ArchMgrSymlinkConfig]]
|
||||
cmds: Optional[ArchMgrCmdsConfig]
|
||||
|
||||
@@ -2,8 +2,8 @@ from typing import Optional, TypedDict
|
||||
|
||||
|
||||
class ArchMgrCmdsConfig(TypedDict):
|
||||
always: list[ArchMgrCommand]
|
||||
once: list[ArchMgrCommand]
|
||||
always: Optional[list[ArchMgrCommand]]
|
||||
once: Optional[list[ArchMgrCommand]]
|
||||
|
||||
|
||||
class ArchMgrCommand(TypedDict):
|
||||
|
||||
+4
-4
@@ -1,13 +1,13 @@
|
||||
from typing import TypedDict
|
||||
from typing import Optional, TypedDict
|
||||
|
||||
|
||||
class ArchMgrGitConfig(TypedDict):
|
||||
creds: ArchMgrGitCredsConfig
|
||||
repos: list[ArchMgrGitRepoConfig]
|
||||
creds: Optional[ArchMgrGitCredsConfig]
|
||||
repos: Optional[list[ArchMgrGitRepoConfig]]
|
||||
|
||||
|
||||
class ArchMgrGitCredsConfig(TypedDict):
|
||||
manager: str
|
||||
manager: Optional[str]
|
||||
|
||||
|
||||
class ArchMgrGitRepoConfig(TypedDict):
|
||||
|
||||
+13
-13
@@ -1,27 +1,27 @@
|
||||
from typing import TypedDict
|
||||
from typing import Optional, TypedDict
|
||||
|
||||
|
||||
class ArchMgrUserConfig(TypedDict):
|
||||
username: str
|
||||
groups: list[str]
|
||||
home_dir: bool
|
||||
sudo_user: bool
|
||||
groups: Optional[list[str]]
|
||||
home_dir: Optional[bool]
|
||||
sudo_user: Optional[bool]
|
||||
|
||||
|
||||
class ArchMgrBootConfig(TypedDict):
|
||||
managed: bool
|
||||
bootloader: str
|
||||
esp_dir: str
|
||||
theme_folder: str
|
||||
os_prober: bool
|
||||
bootloader: Optional[str]
|
||||
esp_dir: Optional[str]
|
||||
theme_folder: Optional[str]
|
||||
os_prober: Optional[bool]
|
||||
|
||||
|
||||
class ArchMgrThemeConfig(TypedDict):
|
||||
gtk: str
|
||||
qt: str
|
||||
font: str
|
||||
icon_theme: str
|
||||
cursor_theme: str
|
||||
gtk: Optional[str]
|
||||
qt: Optional[str]
|
||||
font: Optional[str]
|
||||
icon_theme: Optional[str]
|
||||
cursor_theme: Optional[str]
|
||||
|
||||
|
||||
class ArchMgrTemplateData(TypedDict):
|
||||
|
||||
@@ -2,14 +2,14 @@ from typing import Optional, TypedDict
|
||||
|
||||
|
||||
class ArchMgrPkgConfig(TypedDict):
|
||||
individual: list[str]
|
||||
repos: ArchMgrReposConfig
|
||||
bundles: list[ArchMgrBundleConfig]
|
||||
individual: Optional[list[str]]
|
||||
repos: Optional[ArchMgrReposConfig]
|
||||
bundles: Optional[list[ArchMgrBundleConfig]]
|
||||
|
||||
|
||||
class ArchMgrReposConfig(TypedDict):
|
||||
enabled_repos: list[ArchMgrRepoSettings]
|
||||
reflector: ArchMgrReflectorConfig
|
||||
enabled_repos: Optional[list[ArchMgrRepoSettings]]
|
||||
reflector: Optional[ArchMgrReflectorConfig]
|
||||
|
||||
|
||||
class ArchMgrReflectorConfig(TypedDict):
|
||||
|
||||
Reference in New Issue
Block a user