Files
archmgr/notes.md
T

40 lines
2.0 KiB
Markdown

# Concept for tracking changes
- Create new commit (if possible)
- If force is unset: Diff system's files against current state by copying them into the current state branch
- Then, diff the package state against the state branch by dumping it
- Else, or if no diff, continue
- Render and copy config files into correct directories
- Create config files from presets
- Retrieve explicitly installed packages and remove those that are not present in goal and install those that are not present in current state
# Concept for updating config automatically
1. Track which files contain the setting
2. If there are multiple and is no array, then simply overwrite the last
3. If there are multiple and is array, then remove from the file where it is present and add to last file in requires list
-> To enable this, update the loader to keep more metadata (list of all requires, list of files for each setting)
# Ideas
- [X] function to collect new configs -> Not smart because templates
- [X] config options for users and groups
- [ ] presets for things like desktops (like Hyprland)
- [ ] config options for the template rendering
- [ ] config options for themes
- [ ] grub config
- [ ] Dynamic selection of more configs (i.e. require syntax)
- [X] Own config syntax? -> just use yaml
- [ ] Autocompletion
- [ ] Basic arch install how? -> Probably manual (or semi-automatic)
- [ ] Mounts?
# REGEX
TODO: Improve the below (especially file can be shortened with positive lookahead)
- File: `^(^(~|\\.|\\.\\.)?\\/)?([\\w\\/.-]+(?!.*[^\\w\\/.-]+))`
- Folder: `^(^(~|\\.|\\.\\.)?\\/)?([\\w\\/.-]+(?!.*[^\\w\\/.-]+))\\/$`
- URL (just domain): `^(https?):\\/\\/(([a-z0-9-]+)((?=\\.))\\.)+[a-z]+(?=[a-z]$)`
- Full URL: `^(https?):\\/\\/(([a-z0-9-]+)((?=\\.))\\.)+[a-z]+(?=\\/)\\/([\\w\\-?.=]+(?=\\/[\\w\\-?.=])\\/)*([\\w\\-?&.=\\/]+(?=[\\w\\-.=\\/]$))`
- UNIX username and groups: `^[a-zA-Z0-9\\-._]{2,19}(?=[a-zA-Z0-9]$)`
- Git SSH: `([a-zA-Z0-9\\-._]+(?=[a-zA-Z0-9])[a-zA-Z0-9])@(([a-z0-9\\-]+(?=\\.))\\.)+[a-z]+(?=:):([a-zA-Z0-9\\-._]+(?=\\/)\\/)+([a-zA-Z0-9\\-._]+(?=[a-zA-Z0-9]$))`