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
This commit is contained in:
2026-08-31 00:40:40 +02:00
co-authored by Claude Sonnet 5
parent 3a8dca1fcb
commit 17e579e16c
5 changed files with 75 additions and 31 deletions
+6 -24
View File
@@ -10,14 +10,12 @@
{{- end }}
{{- end }}
{{- if $currentUser }}
{{- /* 1. Parcourir les toolboxes associées à cet hôte */}}
{{- range $toolboxName := $currentUser.toolboxes }}
{{- /* Récupérer la liste des outils pour cette toolbox dans tools.yaml */}}
{{- $toolsList := index $.tools.toolboxes $toolboxName }}
{{- if $toolsList }}
{{- /* Les outils individuels (la liste 'tools:' de l'utilisateur) */}}
{{- if hasKey $currentUser "tools" }}
{{- if $currentUser.tools }}
# Toolbox: {{ $toolboxName }}
{{- range $tool := $toolsList }}
# Outils individuels
{{- range $tool := $currentUser.tools }}
{{- /* Un outil est soit une chaîne ("nom"), soit un objet { nom: {version, ...params mise} } */}}
{{- if kindIs "map" $tool }}
{{- range $toolName, $params := $tool }}
@@ -29,23 +27,7 @@
{{- end }}
{{- end }}
{{- end }}
{{- /* 2. Parcourir les outils individuels (la liste 'tools:' de l'utilisateur) */}}
{{- if hasKey $currentUser "tools" }}
{{- if $currentUser.tools }}
# Outils individuels
{{- range $tool := $currentUser.tools }}
{{- if kindIs "map" $tool }}
{{- range $toolName, $params := $tool }}
{{ $toolName }} = { version = "{{ $params.version | default "latest" }}"{{ range $key, $value := omit $params "version" }}, {{ $key }} = "{{ $value }}"{{ end }} }
{{- end }}
{{- else }}
"{{ $tool }}" = "latest"
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- /* Les toolboxes de cet utilisateur sont générées séparément dans ~/.config/mise/conf.d/<toolbox>.toml */}}
{{- else if $currentHost }}
# Aucun profil trouvé dans hosts.yaml pour l'utilisateur {{ $username }} sur la machine : {{ $hostname }}
{{- else }}