152 lines
4.0 KiB
YAML
152 lines
4.0 KiB
YAML
---
|
|
- 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:
|