Files
config-chezmoi/run_once_after_00-install-mise.sh.tmpl
T
xavierandClaude Sonnet 5 17e579e16c feat(mise): Generate toolbox conf.d files dynamically from tools.yaml
Toolboxes declared in .chezmoidata/tools.yaml no longer need a matching
source file under private_dot_config/mise/conf.d/. The run_onchange
install script now loops over tools.yaml/hosts.yaml directly to
(re)generate ~/.config/mise/conf.d/<toolbox>.toml, and removes files for
toolboxes no longer assigned to the host/user, so mise config.toml stays
limited to individual, non-toolbox tools.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GA4dAzARMnLz1G9AmQkYYn
2026-08-31 00:40:40 +02:00

35 lines
1.2 KiB
Cheetah

#!/usr/bin/env bash
# 1. Installer Mise s'il n'est pas présent
if ! command -v mise &>/dev/null; then
echo "📦 Installation de Mise..."
curl https://mise.run | sh
# S'assurer que mise est immédiatement accessible dans la session du script
export PATH="${HOME}/.local/bin:$PATH"
fi
# 2. Lancer le bootstrap
if command -v mise &>/dev/null; then
echo "🚀 Mise bootstrap..."
mise bootstrap --yes
fi
# 3. Installer tous les outils déclarés dans ~/.config/mise/config.toml et ~/.config/mise/conf.d/*.toml
if command -v mise &>/dev/null; then
echo "⚡ Installation des outils via Mise (dont chezmoi si désiré)..."
mise install --yes
fi
# 4. Nettoyage du binaire chezmoi (maintenant géré par mise)
CURRENT_CHEZMOI="$CHEZMOI_EXECUTABLE" # Chezmoi expose la variable $CHEZMOI_EXECUTABLE pointant vers le binaire en cours d'exécution
MISE_CHEZMOI_BIN="$(mise where chezmoi)/chezmoi"
if [ "$CURRENT_CHEZMOI" != "$MISE_CHEZMOI_BIN" ]; then
echo "🧹 Nettoyage du binaire chezmoi temporaire ($CURRENT_CHEZMOI)..."
rm -fv "$CURRENT_CHEZMOI"
echo "✅ Désormais, seul le chezmoi de mise est actif."
else
echo "✅ La commande chezmoi est déjà gérée par mise."
fi