From 7f85022b4331c6e2af8bf08e71ef282f75d6a68b Mon Sep 17 00:00:00 2001 From: Tobi Date: Fri, 12 Nov 2021 22:54:28 +0100 Subject: [PATCH] Added install stuff for sway --- install_sway.sh | 7 ++ install.sh => install_wsl.sh | 2 +- playbook_sway.yml | 151 +++++++++++++++++++++++++++++++ playbook.yml => playbook_wsl.yml | 0 4 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 install_sway.sh rename install.sh => install_wsl.sh (86%) create mode 100644 playbook_sway.yml rename playbook.yml => playbook_wsl.yml (100%) diff --git a/install_sway.sh b/install_sway.sh new file mode 100644 index 0000000..5c536da --- /dev/null +++ b/install_sway.sh @@ -0,0 +1,7 @@ +pacman-key --init +pacman-key --populate +pacman -Syu --noconfirm git ansible +git clone https://gitea.maiertobi.de/tobimai/setup_ansible_playbooks.git install +cd install +ansible-galaxy install -r requirements.yml +ansible-playbook playbook_sway.yml diff --git a/install.sh b/install_wsl.sh similarity index 86% rename from install.sh rename to install_wsl.sh index c7eb610..6810bab 100644 --- a/install.sh +++ b/install_wsl.sh @@ -4,4 +4,4 @@ pacman -Syu --noconfirm git ansible git clone https://gitea.maiertobi.de/tobimai/setup_ansible_playbooks.git install cd install ansible-galaxy install -r requirements.yml -ansible-playbook playbook.yml +ansible-playbook playbook_wsl.yml diff --git a/playbook_sway.yml b/playbook_sway.yml new file mode 100644 index 0000000..6bfd260 --- /dev/null +++ b/playbook_sway.yml @@ -0,0 +1,151 @@ +--- +- name: Initial installation of WSL arch + hosts: all + become: yes + + pre_tasks: + - name: Run the equivalent of "pacman -Syu" as a separate step + community.general.pacman: + update_cache: yes + upgrade: yes + + - name: Install packages + community.general.pacman: + name: sudo,htop,base-devel,git + state: present + + - name: Make sure we have a 'wheel' group + group: + name: wheel + state: present + + - name: Allow 'wheel' group to have passwordless sudo + lineinfile: + dest: /etc/sudoers + state: present + regexp: '^%wheel' + line: '%wheel ALL=(ALL) NOPASSWD: ALL' + + - name: Add the user tobi + ansible.builtin.user: + name: tobi + password: $6$jUZIIwoMDSg8B3OJ$tRKNJe.YHLVQRkbRSvmPJqE4lFUBVKKDxy.K688SW.gUP8VdfrkUeIIa7XqI8ovpncoZlt5VbGk7WxMKBCS191 + comment: Tobias Maier + groups: wheel + shell: /bin/zsh + + - name: Add name to git config + community.general.git_config: + name: user.name + scope: global + value: Tobias Maier + + - name: Add email to git config + community.general.git_config: + name: user.email + scope: global + value: git@maiertobi.de + + - name: Create the `aur_builder` user + ansible.builtin.user: + name: aur_builder + create_home: yes + group: wheel + + - name: Allow the `aur_builder` user to run `sudo pacman` without a password + ansible.builtin.lineinfile: + path: /etc/sudoers.d/11-install-aur_builder + line: 'aur_builder ALL=(ALL) NOPASSWD: /usr/bin/pacman' + create: yes + validate: 'visudo -cf %s' + + - name: Add number of CPUs to MAKEPKG + ansible.builtin.lineinfile: + path: /etc/makepkg.conf + line: 'MAKEFLAGS="-j$(nproc)"' + create: yes + + - name: Install paru using makepkg if it isn't installed already + kewlfft.aur.aur: + name: paru + use: makepkg + state: present + become: yes + become_user: aur_builder + + - name: Install ZSH-GIT from AUR + community.general.pacman: + name: zsh-git + state: present + executable: paru + become: yes + become_user: aur_builder + + + - name: Install packages from AUR + community.general.pacman: + name: zsh-git,oh-my-zsh-git,zsh-theme-powerlevel10k-git,zsh-autosuggestions,zsh-syntax-highlighting,nano,ly + state: present + executable: paru + become: yes + become_user: aur_builder + + + - name: Install Sway stuff + community.general.pacman: + name: sway,foot,foot-terminfo + state: present + executable: paru + become: yes + become_user: aur_builder + + - name: Add WLR_RENDERER_ALLOW_SOFTWARE to /etc/environment + ansible.builtin.lineinfile: + path: /etc/environment + regexp: '^WLR_RENDERER_ALLOW_SOFTWARE=' + line: WLR_RENDERER_ALLOW_SOFTWARE=1 + + + - name: Clone dotfiles + ansible.builtin.git: + repo: https://gitea.maiertobi.de/tobimai/dotfiles.git + dest: /tmp/dotfiles + + - name: Copy rc to home dir + ansible.builtin.copy: + src: //tmp/dotfiles/.zshrc + dest: /home/tobi/.zshrc + owner: tobi + group: tobi + mode: '0644' + remote_src: yes + + - name: Copy p10k to home dir + ansible.builtin.copy: + src: //tmp/dotfiles/.p10k.zsh + dest: /home/tobi/.p10k.zsh + owner: tobi + group: tobi + mode: '0644' + remote_src: yes + + + - name: Ensures sway config direcotry exists + file: path=/home/tobi/.config/sway state=directory + + - name: Copy sway config to config + ansible.builtin.copy: + src: //tmp/dotfiles/sway_config + dest: /home/tobi/.config/sway/config + owner: tobi + group: tobi + mode: '0644' + remote_src: yes + + - name: Enable service ly, and not touch the state + ansible.builtin.service: + name: ly + enabled: yes + + - name: reboot + reboot: diff --git a/playbook.yml b/playbook_wsl.yml similarity index 100% rename from playbook.yml rename to playbook_wsl.yml