diff --git a/commands/commit.py b/commands/commit.py index c18ff3f..e08d5d0 100644 --- a/commands/commit.py +++ b/commands/commit.py @@ -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) diff --git a/config.schema.json b/config.schema.json new file mode 100644 index 0000000..755ecaa --- /dev/null +++ b/config.schema.json @@ -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 +} diff --git a/config.yml b/config.yml new file mode 100644 index 0000000..1e15cc9 --- /dev/null +++ b/config.yml @@ -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/ + +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" diff --git a/config/parser.py b/config/parser.py new file mode 100644 index 0000000..e69de29 diff --git a/config/validator.py b/config/validator.py new file mode 100644 index 0000000..7af6606 --- /dev/null +++ b/config/validator.py @@ -0,0 +1,2 @@ +def validate(): + pass