diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl index 082e727..adb4a87 100644 --- a/.chezmoi.toml.tmpl +++ b/.chezmoi.toml.tmpl @@ -1,4 +1,13 @@ -{{ $shell := promptBoolOnce . "features.shell" "Do you want to install the Fish shell?" true }} +{{- $email := promptStringOnce . "email" "What's your email?" }} +{{- $git_name := promptStringOnce . "git_name" "What's your Git name?" }} + +{{- $shell := promptBoolOnce . "features.shell" "Do you want to install the Fish shell?" true }} +{{- $git := promptBoolOnce . "features.git" "Do you want to install Git?" true }} + +[data] +email = {{ $email | quote }} +git_name = {{ $git_name | quote }} [data.features] shell = {{ $shell }} +git = {{ $git }} diff --git a/home/.chezmoiignore.tmpl b/home/.chezmoiignore.tmpl index 6d8d2c3..64cf7fa 100644 --- a/home/.chezmoiignore.tmpl +++ b/home/.chezmoiignore.tmpl @@ -1,3 +1,6 @@ {{- if not .features.shell }} .config/fish {{- end }} +{{- if not .features.git }} +.config/git +{{- end }} diff --git a/home/private_dot_config/git/config.tmpl b/home/private_dot_config/git/config.tmpl new file mode 100644 index 0000000..0f41b6b --- /dev/null +++ b/home/private_dot_config/git/config.tmpl @@ -0,0 +1,9 @@ +[user] + email = {{ .email }} + name = {{ .git_name }} + +[init] + defaultBranch = main + +[merge] + ff = true diff --git a/setup-script/playbook.yaml b/setup-script/playbook.yaml index effebcd..9f64c51 100644 --- a/setup-script/playbook.yaml +++ b/setup-script/playbook.yaml @@ -25,3 +25,5 @@ roles: - role: shell when: features.shell == true + - role: git + when: features.git == true diff --git a/setup-script/roles/git/tasks/main.yaml b/setup-script/roles/git/tasks/main.yaml new file mode 100644 index 0000000..4cf4113 --- /dev/null +++ b/setup-script/roles/git/tasks/main.yaml @@ -0,0 +1,5 @@ +- name: Install Git on Arch + become: true + ansible.builtin.pacman: + name: git + when: chezmoi.osRelease.id == "arch"