feat(core): migrate system state to unified declarative JSON

- Consolidate all configuration toggles (suspend, idle, waybar, etc.) into ~/.config/home-manager/state.json
- Introduce nomarchy.toggles and nomarchy.hyprland options in Nix
- Inject toggle states into all bin/ scripts via environment variables
- Update toggle scripts to mutate JSON and trigger background rebuilds
- Add a migration script to transition legacy flag files to the new format
This commit is contained in:
Bernardo Magri
2026-04-04 10:11:09 +01:00
parent f1ed0d7f47
commit cfd5e4bb65
23 changed files with 378 additions and 173 deletions

View File

@@ -7,9 +7,8 @@ VS_CODE_THEME="$HOME/.config/nomarchy/current/theme/vscode.json"
set_theme() {
local editor_cmd="$1"
local settings_path="$2"
local skip_flag="$3"
nomarchy-cmd-present "$editor_cmd" && [[ ! -f $skip_flag ]] || return 0
nomarchy-cmd-present "$editor_cmd" && [[ $NOMARCHY_TOGGLE_SKIP_VSCODE_THEME != "true" ]] || return 0
if [[ -f $VS_CODE_THEME ]]; then
theme_name=$(jq -r '.name' "$VS_CODE_THEME")
@@ -34,7 +33,7 @@ set_theme() {
fi
}
set_theme "code" "$HOME/.config/Code/User/settings.json" "$HOME/.local/state/nomarchy/toggles/skip-vscode-theme-changes"
set_theme "code-insiders" "$HOME/.config/Code - Insiders/User/settings.json" "$HOME/.local/state/nomarchy/toggles/skip-vscode-insiders-theme-changes"
set_theme "codium" "$HOME/.config/VSCodium/User/settings.json" "$HOME/.local/state/nomarchy/toggles/skip-codium-theme-changes"
set_theme "cursor" "$HOME/.config/Cursor/User/settings.json" "$HOME/.local/state/nomarchy/toggles/skip-cursor-theme-changes"
set_theme "code" "$HOME/.config/Code/User/settings.json"
set_theme "code-insiders" "$HOME/.config/Code - Insiders/User/settings.json"
set_theme "codium" "$HOME/.config/VSCodium/User/settings.json"
set_theme "cursor" "$HOME/.config/Cursor/User/settings.json"