refactor: migrate to role-based variable management and blockinfile config

This commit is contained in:
Tuan-Dat Tran
2026-03-22 23:46:42 +01:00
parent 222062c1a4
commit 4a1da18801
13 changed files with 146 additions and 93 deletions

View File

@@ -7,17 +7,15 @@
state: present
- name: Remove existing config files before stowing
shell: |
[ -L ~/.config/hypr/hyprland.conf ] || rm -f ~/.config/hypr/hyprland.conf
[ -L ~/.config/starship ] || rm -rf ~/.config/starship
[ -L ~/.config/zellij ] || rm -rf ~/.config/zellij
changed_when: false
file:
path: "{{ archsetup_user_home }}/.config/{{ item }}"
state: absent
loop:
- hypr
- zellij
- name: Create symlinks with stow
shell: |
cd {{ lookup('env', 'HOME') }}/archsetup/dotfiles
stow -t ~ hypr starship zellij
command: stow --target={{ archsetup_user_home }} {{ dotfiles_stow_packages | join(' ') }}
args:
executable: /bin/bash
creates: "{{ lookup('env', 'HOME') }}/.config/starship"
chdir: "{{ lookup('env', 'HOME') }}/archsetup/dotfiles"
creates: "{{ archsetup_user_home }}/.config/hypr"
chdir: "{{ archsetup_dir }}/dotfiles"