fix
Some checks are pending
quality / changes (push) Waiting to run
quality / Flake Check (push) Blocked by required conditions
quality / Nix Format Check (push) Blocked by required conditions
quality / Deploy netty (push) Blocked by required conditions

This commit is contained in:
Harivansh Rathi 2026-04-08 18:27:05 -04:00
parent c84611bdf1
commit 856f200244
4 changed files with 134 additions and 102 deletions

View file

@ -14,6 +14,8 @@ in
++ lib.optionals hostConfig.isDarwin (builtins.attrValues customScripts.darwinPackages);
home.activation.initializeThemeState = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
${customScripts.themeAssetsText}
mkdir -p "${customScripts.theme.paths.stateDir}" \
"${customScripts.theme.paths.fzfDir}" \
"${customScripts.theme.paths.ghosttyDir}" \
@ -25,36 +27,20 @@ in
mode=$(tr -d '[:space:]' < "${customScripts.theme.paths.stateFile}")
else
mode="${customScripts.theme.defaultMode}"
printf '%s\n' "$mode" > "${customScripts.theme.paths.stateFile}"
fi
case "$mode" in
light)
fzf_target="${customScripts.theme.paths.fzfDir}/cozybox-light"
ghostty_target="${customScripts.theme.paths.ghosttyDir}/cozybox-light"
tmux_target="${customScripts.tmuxConfigs.light}"
lazygit_target="${customScripts.theme.paths.lazygitDir}/config-light.yml"
;;
*)
printf '%s\n' "${customScripts.theme.defaultMode}" > "${customScripts.theme.paths.stateFile}"
fzf_target="${customScripts.theme.paths.fzfDir}/cozybox-dark"
ghostty_target="${customScripts.theme.paths.ghosttyDir}/cozybox-dark"
tmux_target="${customScripts.tmuxConfigs.dark}"
lazygit_target="${customScripts.theme.paths.lazygitDir}/config-dark.yml"
;;
esac
mode="$(theme_normalize_mode "$mode")"
printf '%s\n' "$mode" > "${customScripts.theme.paths.stateFile}"
theme_load_mode_assets "$mode"
ln -sfn "$fzf_target" "${customScripts.theme.paths.fzfCurrentFile}"
ln -sfn "$ghostty_target" "${customScripts.theme.paths.ghosttyCurrentFile}"
ln -sfn "$tmux_target" "${customScripts.theme.paths.tmuxCurrentFile}"
ln -sfn "$lazygit_target" "${customScripts.theme.paths.lazygitCurrentFile}"
ln -sfn "$THEME_FZF_TARGET" "${customScripts.theme.paths.fzfCurrentFile}"
ln -sfn "$THEME_GHOSTTY_TARGET" "${customScripts.theme.paths.ghosttyCurrentFile}"
ln -sfn "$THEME_TMUX_TARGET" "${customScripts.theme.paths.tmuxCurrentFile}"
ln -sfn "$THEME_LAZYGIT_TARGET" "${customScripts.theme.paths.lazygitCurrentFile}"
${lib.optionalString hostConfig.isDarwin ''
lg_darwin="${config.home.homeDirectory}/Library/Application Support/lazygit"
mkdir -p "$lg_darwin"
case "$mode" in
light) ln -sfn "$lg_darwin/config-light.yml" "$lg_darwin/config.yml" ;;
*) ln -sfn "$lg_darwin/config-dark.yml" "$lg_darwin/config.yml" ;;
esac
ln -sfn "$THEME_DARWIN_LAZYGIT_TARGET" "$lg_darwin/config.yml"
''}
# seed wallpapers from static assets if no generated ones exist yet
@ -66,10 +52,6 @@ in
fi
# ensure wallpaper symlink points to active mode
case "$mode" in
light) wp_target="${customScripts.theme.wallpapers.light}" ;;
*) wp_target="${customScripts.theme.wallpapers.dark}" ;;
esac
ln -sfn "$wp_target" "${customScripts.theme.wallpapers.current}"
ln -sfn "$THEME_WALLPAPER" "${customScripts.theme.wallpapers.current}"
'';
}