feat(mise): Automate ~/.config/mise/config.toml generation based on yaml data and some logic

This commit is contained in:
2026-07-15 15:40:17 +02:00
parent ba28af01ed
commit ef95b6f198
6 changed files with 197 additions and 97 deletions
+33
View File
@@ -0,0 +1,33 @@
{{/* .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 -}}
{{- 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 }}