From e28efad0c0bc5d128b8019cb5b0859e2beb008de Mon Sep 17 00:00:00 2001 From: Nicola Belluti Date: Sat, 4 Oct 2025 12:03:16 +0200 Subject: [PATCH] Added the Fish shell --- .chezmoi.toml.tmpl | 1 + home/.chezmoi.toml.tmpl | 4 ++++ home/.chezmoiignore.tmpl | 3 +++ ...un_before_arch.sh.tmpl => run_before_archlinux.sh.tmpl} | 3 ++- home/private_dot_config/fish/completions/.gitkeep | 0 home/private_dot_config/fish/conf.d/.gitkeep | 0 home/private_dot_config/fish/functions/.gitkeep | 0 home/private_dot_config/fish/remove_config.fish | 0 setup-script/playbook.yaml | 7 +++---- setup-script/roles/shell/tasks/main.yaml | 5 +++++ 10 files changed, 18 insertions(+), 5 deletions(-) create mode 120000 .chezmoi.toml.tmpl create mode 100644 home/.chezmoi.toml.tmpl create mode 100644 home/.chezmoiignore.tmpl rename home/.chezmoiscripts/{run_before_arch.sh.tmpl => run_before_archlinux.sh.tmpl} (95%) create mode 100644 home/private_dot_config/fish/completions/.gitkeep create mode 100644 home/private_dot_config/fish/conf.d/.gitkeep create mode 100644 home/private_dot_config/fish/functions/.gitkeep create mode 100644 home/private_dot_config/fish/remove_config.fish create mode 100644 setup-script/roles/shell/tasks/main.yaml diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl new file mode 120000 index 0000000..97d98fd --- /dev/null +++ b/.chezmoi.toml.tmpl @@ -0,0 +1 @@ +home/.chezmoi.toml.tmpl \ No newline at end of file diff --git a/home/.chezmoi.toml.tmpl b/home/.chezmoi.toml.tmpl new file mode 100644 index 0000000..082e727 --- /dev/null +++ b/home/.chezmoi.toml.tmpl @@ -0,0 +1,4 @@ +{{ $shell := promptBoolOnce . "features.shell" "Do you want to install the Fish shell?" true }} + +[data.features] +shell = {{ $shell }} diff --git a/home/.chezmoiignore.tmpl b/home/.chezmoiignore.tmpl new file mode 100644 index 0000000..6d8d2c3 --- /dev/null +++ b/home/.chezmoiignore.tmpl @@ -0,0 +1,3 @@ +{{- if not .features.shell }} +.config/fish +{{- end }} diff --git a/home/.chezmoiscripts/run_before_arch.sh.tmpl b/home/.chezmoiscripts/run_before_archlinux.sh.tmpl similarity index 95% rename from home/.chezmoiscripts/run_before_arch.sh.tmpl rename to home/.chezmoiscripts/run_before_archlinux.sh.tmpl index 153a949..8294ad6 100755 --- a/home/.chezmoiscripts/run_before_arch.sh.tmpl +++ b/home/.chezmoiscripts/run_before_archlinux.sh.tmpl @@ -46,4 +46,5 @@ echo -e "\e[1;34mRunning the playbook...\e[0m" ANSIBLE_CONFIG="$ANSIBLE_ROOT/ansible.cfg" \ "$ANSIBLE_ROOT/.venv/bin/ansible-playbook" \ "$ANSIBLE_ROOT/playbook.yaml" \ - --extra-vars "$(chezmoi data --format=json)" + --extra-vars "$(chezmoi data --format=json)" \ + --ask-become-pass diff --git a/home/private_dot_config/fish/completions/.gitkeep b/home/private_dot_config/fish/completions/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/home/private_dot_config/fish/conf.d/.gitkeep b/home/private_dot_config/fish/conf.d/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/home/private_dot_config/fish/functions/.gitkeep b/home/private_dot_config/fish/functions/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/home/private_dot_config/fish/remove_config.fish b/home/private_dot_config/fish/remove_config.fish new file mode 100644 index 0000000..e69de29 diff --git a/setup-script/playbook.yaml b/setup-script/playbook.yaml index 85e3022..ce91ef1 100644 --- a/setup-script/playbook.yaml +++ b/setup-script/playbook.yaml @@ -11,7 +11,6 @@ - chezmoi is mapping fail_msg: 'Pass with: --extra-vars "$(chezmoi data --format=json)"' - - name: 'Example: access the "user" fields' - ansible.builtin.debug: - msg: - - "user: {{ chezmoi.username | default('n/a') }}" + roles: + - role: shell + when: features.shell == true diff --git a/setup-script/roles/shell/tasks/main.yaml b/setup-script/roles/shell/tasks/main.yaml new file mode 100644 index 0000000..632f181 --- /dev/null +++ b/setup-script/roles/shell/tasks/main.yaml @@ -0,0 +1,5 @@ +- name: Install Fish shell on Arch + become: true + ansible.builtin.pacman: + name: fish + when: chezmoi.osRelease.id == "arch"