diff --git a/configs.yml b/configs.yml index e7eba44..3635650 100644 --- a/configs.yml +++ b/configs.yml @@ -278,38 +278,6 @@ java: - install: - jdk-openjdk -zsh: - - install: - arch: - - zsh-theme-powerlevel10k - debian: - - zsh-theme-powerlevel9k - both: - - zsh - - zsh-completions - - zsh-autosuggestions - - zsh-syntax-highlighting - - run: - - content='. "$HOME"/setup-cockpit/dotfiles/zsh/zshrc'; grep "$content" "$HOME"/.zshrc >/dev/null 2>&1 || echo "$content" >> "$HOME"/.zshrc - - run: - - content='. "$HOME"/setup-cockpit/dotfiles/zsh/zshenv'; grep "$content" "$HOME"/.zshenv >/dev/null 2>&1 || echo "$content" >> "$HOME"/.zshenv - - run: - - content='. "$HOME"/setup-cockpit/dotfiles/zsh/zprofile'; grep "$content" "$HOME"/.zprofile >/dev/null 2>&1 || echo "$content" >> "$HOME"/.zprofile - - run: - - content='. "$HOME"/setup-cockpit/dotfiles/zsh/p10k.zsh'; grep "$content" "$HOME"/.p10k.zsh >/dev/null 2>&1 || echo "$content" >> "$HOME"/.p10k.zsh - - clone: - url: https://github.com/softmoth/zsh-vim-mode.git - dest: ~/.git_clones/zsh-vim-mode - branch: main - - clone: - url: https://github.com/zsh-users/zsh-autosuggestions.git - dest: ~/.git_clones/zsh-autosuggestions - branch: master - - clone: - url: https://github.com/zsh-users/zsh-syntax-highlighting.git - dest: ~/.git_clones/zsh-syntax-highlighting - branch: master - pacman_hooks: - run: - sudo mkdir -p /etc/pacman.d/hooks diff --git a/playbook.yml b/playbook.yml index 27753a9..2748b87 100644 --- a/playbook.yml +++ b/playbook.yml @@ -6,6 +6,8 @@ tags: base - role: bash tags: bash + - role: zsh + tags: zsh - role: kitty tags: kitty - role: terminator diff --git a/dotfiles/zsh/p10k.zsh b/roles/zsh/files/p10k.zsh similarity index 100% rename from dotfiles/zsh/p10k.zsh rename to roles/zsh/files/p10k.zsh diff --git a/dotfiles/zsh/zprofile b/roles/zsh/files/zprofile similarity index 100% rename from dotfiles/zsh/zprofile rename to roles/zsh/files/zprofile diff --git a/dotfiles/zsh/zshenv b/roles/zsh/files/zshenv similarity index 100% rename from dotfiles/zsh/zshenv rename to roles/zsh/files/zshenv diff --git a/dotfiles/zsh/zshrc b/roles/zsh/files/zshrc similarity index 100% rename from dotfiles/zsh/zshrc rename to roles/zsh/files/zshrc diff --git a/roles/zsh/tasks/main.yml b/roles/zsh/tasks/main.yml new file mode 100644 index 0000000..394b1f5 --- /dev/null +++ b/roles/zsh/tasks/main.yml @@ -0,0 +1,38 @@ +--- + +- name: Install bash-completion (Archlinux) + become: true + pacman: + name: + - zsh-theme-powerlevel10k + - zsh + - zsh-completions + - zsh-autosuggestions + - zsh-syntax-highlighting + when: ansible_distribution == 'Archlinux' + +- name: Install bash-completion (Debian) + become: true + apt: + name: + - zsh-theme-powerlevel9k + - zsh + - zsh-completions + - zsh-autosuggestions + - zsh-syntax-highlighting + when: ansible_distribution == 'Debian' + +- name: Copy files + copy: src={{ item.src }} dest={{ item.dest }} backup=true + with_items: + - { src: 'zshrc', dest: '~/.zshrc' } + - { src: 'zshenv', dest: '~/.zshenv' } + - { src: 'zprofile', dest: '~/.zprofile' } + - { src: 'p10k.zsh', dest: '~/.p10k.zsh' } + +- name: Clone repos + git: repo={{ item.repo }} dest={{ item.dest }} clone=yes version={{ item.version }} + with_items: + - { repo: 'https://github.com/softmoth/zsh-vim-mode.git', dest: '~/.git_clones/zsh-vim-mode', version: 'main' } + - { repo: 'https://github.com/zsh-users/zsh-autosuggestions.git', dest: '~/.git_clones/zsh-autosuggestions', version: 'master' } + - { repo: 'https://github.com/zsh-users/zsh-syntax-highlighting.git', dest: '~/.git_clones/zsh-syntax-highlighting', version: 'master' }