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:
@@ -11,12 +11,14 @@ if [[ -z $font_name ]]; then
|
||||
fi
|
||||
|
||||
STATE_DIR="$HOME/.config/home-manager"
|
||||
STATE_FILE="$STATE_DIR/font-state.nix"
|
||||
STATE_FILE="$STATE_DIR/state.json"
|
||||
|
||||
mkdir -p "$STATE_DIR"
|
||||
[[ ! -f $STATE_FILE ]] && echo "{}" > "$STATE_FILE"
|
||||
|
||||
if fc-list | grep -iq "$font_name"; then
|
||||
echo "$font_name" > "$STATE_FILE"
|
||||
TMP_JSON=$(mktemp)
|
||||
jq ".font = \"$font_name\"" "$STATE_FILE" > "$TMP_JSON" && mv "$TMP_JSON" "$STATE_FILE"
|
||||
echo "Font set to $font_name declaratively. Applying changes..."
|
||||
env-update
|
||||
|
||||
|
||||
Reference in New Issue
Block a user