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:
@@ -42,11 +42,18 @@ let
|
||||
cp -r * $out/bin/
|
||||
chmod +x $out/bin/*
|
||||
|
||||
# Wrap every script to ensure dependencies are in PATH
|
||||
# Wrap every script to ensure dependencies are in PATH and inject configuration
|
||||
for file in $out/bin/*; do
|
||||
if [ -f "$file" ]; then
|
||||
wrapProgram "$file" \
|
||||
--prefix PATH : ${lib.makeBinPath nomarchy-deps}
|
||||
--prefix PATH : ${lib.makeBinPath nomarchy-deps} \
|
||||
--set NOMARCHY_TOGGLE_SUSPEND "${if config.nomarchy.toggles.suspend then "true" else "false"}" \
|
||||
--set NOMARCHY_TOGGLE_SCREENSAVER "${if config.nomarchy.toggles.screensaver then "true" else "false"}" \
|
||||
--set NOMARCHY_TOGGLE_IDLE "${if config.nomarchy.toggles.idle then "true" else "false"}" \
|
||||
--set NOMARCHY_TOGGLE_NIGHTLIGHT "${if config.nomarchy.toggles.nightlight then "true" else "false"}" \
|
||||
--set NOMARCHY_TOGGLE_WAYBAR "${if config.nomarchy.toggles.waybar then "true" else "false"}" \
|
||||
--set NOMARCHY_TOGGLE_SKIP_VSCODE_THEME "${if config.nomarchy.toggles.skipVsCodeTheme then "true" else "false"}" \
|
||||
--set NOMARCHY_MONOSPACE_FONT "${config.nomarchy.fonts.monospace}"
|
||||
fi
|
||||
done
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user