system/books/void_wayland.yaml

174 lines
4.5 KiB
YAML

- name: Install void wayland environment
hosts: target_system
become: true
tags: wayland
tasks:
- name: Install intel wayland drivers
community.general.xbps:
name:
- mesa-dri
state: present
- name: Install wayland packages
community.general.xbps:
name:
- dbus
- seatd
- turnstile
state: present
# notify: installed-wayland -> TODO: Use handler? Currently using task below
- name: Activate wayland services
ansible.builtin.file:
force: "yes"
src: "/etc/sv/{{ item }}"
dest: "/etc/runit/runsvdir/default/{{ item }}"
state: link
with_items: [dbus, turnstiled, seatd]
- name: Set user service directory to $HOME/.local/state/service
ansible.builtin.copy:
src: runit.conf
dest: /etc/turnstile/backend/runit.conf
mode: 0644
- name: Install wlr desktop portals
community.general.xbps:
name:
- xdg-desktop-portal
- xdg-desktop-portal-wlr
state: present
tags: desktop-portal
- name: Install qt5 and qt6 wayland libraries
community.general.xbps:
name:
- qt5-wayland
- qt6-wayland
state: present
tags: qt-wayland
- name: Set up display manager
hosts: target_system
become: true
vars:
greeter_user: _greeter
tags:
- wayland
- greetd
- tuigreet
tasks:
- name: Ensure user group for greeter exists
ansible.builtin.group:
name: "{{ greeter_user }}"
state: present
- name: Install greetd and tuigreet
community.general.xbps:
name:
- greetd
- tuigreet
state: present
- name: Set up tuigreet config for greetd
ansible.builtin.template:
src: greetd-config.toml.j2
dest: "/etc/greetd/config.toml"
owner: root
group: root
mode: 0644
force: true
- name: Activate greetd service
ansible.builtin.file:
src: "/etc/sv/greetd"
dest: "/etc/runit/runsvdir/default/greetd"
state: link
- name: Install audio and video for wayland
hosts: target_system
become: true
tags: audio
vars:
audio_groups: [audio, video]
tasks:
- name: Ensure user group for audio/video exists
ansible.builtin.group:
name: "{{ item }}"
state: present
loop: "{{ audio_groups }}"
- name: Put user in audio group
ansible.builtin.user:
name: "{{ user_name }}"
groups: "{{ audio_groups }}"
append: true
- name: Install pipewire
community.general.xbps:
name:
- pipewire
state: present
notify: installed-pipewire
- name: Install pipewire bluetooth
community.general.xbps:
name:
- libspa-bluetooth
state: present
tags: bluetooth
handlers:
- name: Set up wireplumber to auto start
ansible.builtin.file:
dest: "/etc/pipewire/pipewire.conf.d"
state: directory
listen: installed-pipewire
# FIXME: Does not work automatically for some reason?
- name: Set up wireplumber to auto start
ansible.builtin.file:
force: "yes"
src: "/usr/share/examples/wireplumber/10-wireplumber.conf"
dest: "/etc/pipewire/pipewire.conf.d/10-wireplumber.conf"
state: link
listen: installed-pipewire
- name: Enable pipewire-pulse interface
ansible.builtin.file:
force: "yes"
src: "/usr/share/examples/pipewire/20-pipewire-pulse.conf"
dest: "/etc/pipewire/pipewire.conf.d/20-pipewire-pulse.conf"
state: link
listen: installed-pipewire
## TODO: Enable its start in river init script
#
# TODO: Find way to install and enable pipewire-roc-sink module (and enable ~/.config/pipewire/pipewire.conf.d/roc-sink.conf)
- name: Allow user to manage system power
hosts: target_system
become: true
tags:
- power
tasks:
- name: Ensure user group "power" exists
ansible.builtin.group:
name: power
state: present
- name: Put user in power group
ansible.builtin.user:
name: "{{ user_name }}"
groups: [power]
append: true
- name: Enable power management for power group
ansible.builtin.copy:
content: "%power ALL=(ALL) NOPASSWD: /usr/bin/halt, /usr/bin/poweroff, /usr/bin/reboot, /usr/bin/shutdown, /usr/bin/zzz, /usr/bin/ZZZ"
dest: "/etc/sudoers.d/20-power"
owner: root
group: root
mode: 0644
force: true