diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl new file mode 100644 index 0000000..a6b8e59 --- /dev/null +++ b/.chezmoi.toml.tmpl @@ -0,0 +1,8 @@ +{{- $osid := .chezmoi.os -}} +{{- if hasKey .chezmoi.osRelease "id" -}} +{{- $osid = printf "%s-%s" .chezmoi.os .chezmoi.osRelease.id -}} +{{- end -}} + +[data] + osid = {{ $osid | quote }} + diff --git a/run_once_install.sh.tmpl b/run_once_install.sh.tmpl index 6d26d49..b1f5b19 100644 --- a/run_once_install.sh.tmpl +++ b/run_once_install.sh.tmpl @@ -1,16 +1,12 @@ #!/usr/bin/env sh echo "Running installation script\n" -{{- if eq .chezmoi.os "linux" }} -{{- if hasKey .chezmoi.osRelease "id" }} # avoid M1 mac osRelease.id not exist -{{- if eq .chezmoi.osRelease.id "alpine" }} +{{- if eq .osid "linux-alpine" }} apk update apk add zsh tmux perl bash -{{- else if (or (eq .chezmoi.osRelease.id "debian") (eq .chezmoi.osRelease.id "ubuntu")) }} +{{- else if (or (eq .osid "debian") (eq .osid "ubuntu")) }} sudo apt update sudo apt install zsh tmux perl bash -y -{{- end }} -{{- end }} -{{- else if eq .chezmoi.os "darwin" }} +{{- else if eq .osid "darwin" }} brew install neovim zsh tmux perl {{- end }} # curl -sS https://webinstall.dev/webi | bash