env/roles/shell-tweaks/tasks/main.yml
2024-10-13 19:36:06 -04:00

50 lines
2 KiB
YAML

---
- name: Ensure general config dir exists
file:
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config"
state: directory
- name: Install OMZsh
shell: |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
args:
creates: "{{ lookup('ansible.builtin.env', 'HOME') }}/.oh-my-zsh"
- name: Ensure .zshrc exists
file:
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.zshrc"
state: touch
- name: Add zsh managed block
blockinfile:
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.zshrc"
marker: "# Marc's env managed block - {mark}"
block: "{{ lookup('ansible.builtin.file', 'files/shell_extras') }}"
- name: Install Starship
shell: $HOME/.cargo/bin/cargo install starship
- name: Ensure Starship config exists
file:
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/starship.toml"
state: touch
- name: Add starship managed block
blockinfile:
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/starship.toml"
marker: "# Marc's env managed block - {mark}"
block: "{{ lookup('ansible.builtin.file', 'files/starship.toml') }}"
# TODO: Add gh cli login.
#- name: Check if gh-dash is installed
# shell: gh extension list
# register: gh_ext_list
#- name: Install gh CLI extensions (gh-dash)
# command: gh extension install dlvhdr/gh-dash
# when: gh_ext_list.stdout.find('gh dash') == -1
#- name: Ensure gh-dash config directory exists
# file:
# path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/gh-dash"
# state: directory
#- name: Ensure gh-dash config exists
# file:
# path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/gh-dash/config.yml"
# state: touch
#- name: Add gh-dash configuration managed block
# blockinfile:
# path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/gh-dash/config.yml"
# marker: "# Marc's env managed block - {mark}"
# block: "{{ lookup('ansible.builtin.file', 'files/gh-dash.yml') }}"