Files
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

36 lines
1.5 KiB
Plaintext

{{/* .chezmoitemplates/mise-tools */}}
{{- $hostname := output "hostname" | trim -}}
{{- $username := .chezmoi.username }}
# Configuration personnalisée pour l'utilisateur {{ $username }} et l'hôte {{ $hostname }}
{{- $currentHost := index .hosts $hostname -}}
{{- $currentUser := "" -}}
{{- if $currentHost }}
{{- if hasKey $currentHost.users $username }}
{{- $currentUser = index $currentHost.users $username -}}
{{- end }}
{{- end }}
{{- if $currentUser }}
{{- /* Les outils individuels (la liste 'tools:' de l'utilisateur) */}}
{{- if hasKey $currentUser "tools" }}
{{- if $currentUser.tools }}
# 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 }}
{{ $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 }}
# Aucun profil trouvé dans hosts.yaml pour la machine : {{ $hostname }}
{{- end }}