Compare commits

..
2 Commits
Author SHA1 Message Date
xavierandClaude Sonnet 5 dd229593aa feat(mise): Support tools with custom mise params (e.g. tea)
Replace the hardcoded 'tea' special case in mise-tools with a generic
mechanism: a tool entry in tools.yaml/hosts.yaml can now be either a
plain string ("latest") or a map keyed by tool name whose value holds
mise params (version, url, asset_pattern, ...). This generalizes to
any future tool needing more than "latest", instead of requiring a
new hardcoded branch per tool.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-16 22:23:26 +02:00
xavierandClaude Sonnet 5 bbda4fdbcb feat(mise): Add per-user toolsets to hosts.yaml
Nest each host's toolboxes/tools/configs under users.<username> so
root and xavier can have different tool selections on the same
machine, instead of sharing one profile per host.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-16 22:09:18 +02:00
3 changed files with 90 additions and 45 deletions
+63 -35
View File
@@ -2,43 +2,71 @@
hosts: hosts:
# PC perso # PC perso
intel-nuc-hades-canyon: intel-nuc-hades-canyon:
toolboxes: users:
- terminal xavier:
- dev-tools toolboxes:
- dev-languages - terminal
- ai - dev-tools
tools: - dev-languages
- vivid - ai
- pipx:vit tools:
- pipx:speedtest-cli - vivid
- pipx:asciinema - pipx:vit
configs: {} - pipx:speedtest-cli
- pipx:asciinema
configs: {}
root:
toolboxes:
- terminal
tools: []
configs: {}
# Serveur dédié # Serveur dédié
cloud: cloud:
toolboxes: users:
- terminal xavier:
- dev-tools toolboxes:
- dev-languages - terminal
- ai - dev-tools
tools: - dev-languages
- pipx:vit - ai
configs: {} tools:
- pipx:vit
configs: {}
root:
toolboxes:
- terminal
tools: []
configs: {}
# Container de dev # Container de dev
devenv: devenv:
toolboxes: users:
- terminal xavier:
- dev-tools toolboxes:
- dev-languages - terminal
- devops - dev-tools
- ai - dev-languages
tools: - devops
- sops - ai
- age tools:
- cargo:rage - sops
configs: {} - age
- cargo:rage
configs: {}
root:
toolboxes:
- terminal
tools: []
configs: {}
termux-debian: termux-debian:
toolboxes: users:
- terminal xavier:
- dev-tools toolboxes:
tools: {} - terminal
configs: {} - dev-tools
tools: {}
configs: {}
root:
toolboxes:
- terminal
tools: []
configs: {}
+3 -2
View File
@@ -19,8 +19,9 @@ tools:
- lazygit - lazygit
- delta - delta
- gh - gh
- tea - tea:
# tea = { version = "0.14.2", url = 'https://gitea.com/gitea/tea/releases/download/v{{- "{{" }} version {{ "}}" -}}/tea-{{- "{{" }} version {{ "}}" -}}-{{- "{{" }} os() {{ "}}" -}}-{{- "{{" }} arch(x64="amd64") {{ "}}" -}}.xz' } version: "0.14.2"
url: "https://gitea.com/gitea/tea/releases/download/v{{ version }}/tea-{{ version }}-{{ os() }}-{{ arch(x64='amd64') }}.xz"
- jq - jq
- yq - yq
- shellcheck - shellcheck
+24 -8
View File
@@ -3,18 +3,26 @@
{{- $username := .chezmoi.username }} {{- $username := .chezmoi.username }}
# Configuration personnalisée pour l'utilisateur {{ $username }} et l'hôte {{ $hostname }} # Configuration personnalisée pour l'utilisateur {{ $username }} et l'hôte {{ $hostname }}
{{- $currentHost := index .hosts $hostname -}} {{- $currentHost := index .hosts $hostname -}}
{{- $currentUser := "" -}}
{{- if $currentHost }} {{- if $currentHost }}
{{- if hasKey $currentHost.users $username }}
{{- $currentUser = index $currentHost.users $username -}}
{{- end }}
{{- end }}
{{- if $currentUser }}
{{- /* 1. Parcourir les toolboxes associées à cet hôte */}} {{- /* 1. Parcourir les toolboxes associées à cet hôte */}}
{{- range $toolboxName := $currentHost.toolboxes }} {{- range $toolboxName := $currentUser.toolboxes }}
{{- /* Récupérer la liste des outils pour cette toolbox dans tools.yaml */}} {{- /* Récupérer la liste des outils pour cette toolbox dans tools.yaml */}}
{{- $toolsList := index $.tools.toolboxes $toolboxName }} {{- $toolsList := index $.tools.toolboxes $toolboxName }}
{{- if $toolsList }} {{- if $toolsList }}
# Toolbox: {{ $toolboxName }} # Toolbox: {{ $toolboxName }}
{{- range $tool := $toolsList }} {{- range $tool := $toolsList }}
{{- /* Gestion fine du cas particulier de 'tea' mis en commentaire dans votre yaml */}} {{- /* Un outil est soit une chaîne ("nom"), soit un objet { nom: {version, ...params mise} } */}}
{{- if eq $tool "tea" }} {{- if kindIs "map" $tool }}
tea = { version = "0.14.2", url = "https://gitea.com/gitea/tea/releases/download/v{{`{{ version }}`}}/tea-{{`{{ version }}`}}-{{`{{ os() }}`}}-{{`{{ arch(x64='amd64') }}`}}.xz" } {{- range $toolName, $params := $tool }}
{{ $toolName }} = { version = "{{ $params.version | default "latest" }}"{{ range $key, $value := omit $params "version" }}, {{ $key }} = "{{ $value }}"{{ end }} }
{{- end }}
{{- else }} {{- else }}
"{{ $tool }}" = "latest" "{{ $tool }}" = "latest"
{{- end }} {{- end }}
@@ -22,16 +30,24 @@ tea = { version = "0.14.2", url = "https://gitea.com/gitea/tea/releases/download
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- /* 2. Parcourir les outils individuels (la liste 'tools:' du host) */}} {{- /* 2. Parcourir les outils individuels (la liste 'tools:' de l'utilisateur) */}}
{{- if hasKey $currentHost "tools" }} {{- if hasKey $currentUser "tools" }}
{{- if $currentHost.tools }} {{- if $currentUser.tools }}
# Outils individuels # Outils individuels
{{- range $tool := $currentHost.tools }} {{- 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" "{{ $tool }}" = "latest"
{{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- else if $currentHost }}
# Aucun profil trouvé dans hosts.yaml pour l'utilisateur {{ $username }} sur la machine : {{ $hostname }}
{{- else }} {{- else }}
# Aucun profil trouvé dans hosts.yaml pour la machine : {{ $hostname }} # Aucun profil trouvé dans hosts.yaml pour la machine : {{ $hostname }}
{{- end }} {{- end }}