Files
config-chezmoi/.chezmoitemplates/mise-bootstrap-packages
T
xavier a4e2eadbe9 feat(mise): Allow to declare bootstrap package per host
Whitout this, you can only specify packages per os (distrib).
2026-08-03 22:28:22 +02:00

56 lines
1.3 KiB
Plaintext

{{/* .chezmoitemplates/mise-bootstrap-packages */}}
{{- $isUbuntu := false -}}
{{- $isUbuntuServer := false -}}
{{- $isUbuntuDesktop := false -}}
{{- if and (eq .chezmoi.os "linux") (hasKey .chezmoi "osRelease") (eq .chezmoi.osRelease.id "ubuntu") -}}
{{- $isUbuntu = true -}}
{{- if stat "/usr/bin/gnome-shell" }}
{{- $isUbuntuDesktop = true -}}
{{- end }}
{{- end -}}
{{/* Debian */}}
{{- if and (eq .chezmoi.os "linux") (hasKey .chezmoi "osRelease") (eq .chezmoi.osRelease.id "debian") -}}
# Debian common
{{- range .packages.debian.common }}
"apt:{{- . }}" = "latest"
{{- end }}
{{- end -}}
{{/* Ubuntu */}}
{{- if $isUbuntu }}
# Ubuntu common
{{- range .packages.ubuntu.common }}
"apt:{{- . }}" = "latest"
{{- end }}
{{- if $isUbuntuServer }}
# Ubuntu server
{{- range .packages.ubuntu.server }}
"apt:{{- . }}" = "latest"
{{- end }}
{{- end }}
{{- if $isUbuntuDesktop }}
# Ubuntu desktop
{{- range .packages.ubuntu.desktop }}
"apt:{{- . }}" = "latest"
{{- end }}
{{- end }}
{{- end }}
{{/* Host specific */}}
{{- $hostname := output "hostname" | trim -}}
{{- $currentHost := index .hosts $hostname -}}
{{- if $currentHost }}
{{- if hasKey $currentHost "packages" }}
# Paquets personnalisés pour l'hôte {{ $hostname }}
{{- range $currentHost.packages }}
"{{- . }}" = "latest"
{{- end }}
{{- end }}
{{- end }}