2021-06-16 22:57:18 +02:00
|
|
|
# TODO For other distributions
|
|
|
|
|
2021-06-19 16:52:28 +02:00
|
|
|
# Package are installed with --asdeps because they are needed
|
2021-06-16 22:57:18 +02:00
|
|
|
|
|
|
|
# Xorg configuration
|
|
|
|
|
|
|
|
- name: Check if there is Intel backlight
|
|
|
|
stat:
|
|
|
|
path: /sys/class/backlight/intel_backlight
|
|
|
|
register: intel_backlight
|
2021-06-18 21:53:42 +02:00
|
|
|
when: display_server == 'x11'
|
2021-06-16 22:57:18 +02:00
|
|
|
|
|
|
|
- name: Install Intel video drivers (Arch based)
|
|
|
|
pacman:
|
|
|
|
name: xf86-video-intel
|
|
|
|
# state: "{{ intel_backlight.stat.exists }}"
|
|
|
|
state: present
|
|
|
|
become: yes
|
2021-06-18 21:53:42 +02:00
|
|
|
when: display_server == 'x11' and intel_backlight.stat.exists and arch_based
|
2021-06-19 16:52:28 +02:00
|
|
|
# TODO With software role? Would permit other distributions
|
2021-06-16 22:57:18 +02:00
|
|
|
|
|
|
|
- name: Configure Xorg Intel backlight
|
|
|
|
copy:
|
|
|
|
src: xorg/intel_backlight.conf
|
|
|
|
dest: "{{ item }}/20-intel_backlight.conf"
|
|
|
|
become: yes
|
2021-06-18 21:53:42 +02:00
|
|
|
when: display_server == 'x11' and intel_backlight.stat.exists
|
2021-06-16 22:57:18 +02:00
|
|
|
notify: etc changed
|
|
|
|
loop: "{{ xorg_common_config_dirs }}"
|
|
|
|
|
|
|
|
- name: Configure Xorg joystick behaviour
|
|
|
|
copy:
|
|
|
|
src: xorg/joystick.conf
|
|
|
|
dest: "{{ item }}/50-joystick.conf"
|
|
|
|
become: yes
|
2021-06-18 21:53:42 +02:00
|
|
|
when: display_server == 'x11'
|
2021-06-16 22:57:18 +02:00
|
|
|
notify: etc changed
|
|
|
|
loop: "{{ xorg_common_config_dirs }}"
|
|
|
|
|
2021-06-21 22:01:48 +02:00
|
|
|
- name: List modules we're using
|
|
|
|
slurp:
|
|
|
|
src: /proc/modules
|
|
|
|
register: modules
|
|
|
|
when: display_server
|
|
|
|
# Not sure the module will be loaded in early setup stages though
|
|
|
|
|
|
|
|
- name: Make panfrost use OpenGL 3.3
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/environment
|
|
|
|
line: 'PAN_MESA_DEBUG="gl3"'
|
|
|
|
regexp: '^#? ?PAN_MESA_DEBUG='
|
|
|
|
become: yes
|
|
|
|
when: display_server and using_panfrost
|
|
|
|
vars:
|
|
|
|
using_panfrost: "{{ 'panfrost' in (modules.content | b64decode) }}"
|
|
|
|
notify: panfrost config changed
|
|
|
|
|
2021-06-16 22:57:18 +02:00
|
|
|
# Numlock on boot
|
|
|
|
|
|
|
|
- name: set numlock on boot
|
|
|
|
copy:
|
|
|
|
src: getty.service
|
|
|
|
dest: /etc/systemd/system/getty@.service.d/override.conf
|
|
|
|
become: yes
|
|
|
|
notify:
|
|
|
|
- etc changed
|
|
|
|
- systemd changed
|
|
|
|
when: auto_numlock
|
|
|
|
|
|
|
|
- name: Unset numlock on boot
|
|
|
|
file:
|
|
|
|
path: /etc/systemd/system/getty@.service.d/override.conf
|
|
|
|
state: absent
|
|
|
|
become: yes
|
|
|
|
notify:
|
|
|
|
- etc changed
|
|
|
|
- systemd changed
|
|
|
|
when: not auto_numlock
|
|
|
|
|
2023-10-25 00:27:06 +02:00
|
|
|
### STOPPED HERE ###
|
2021-06-16 22:57:18 +02:00
|
|
|
|
2021-06-23 21:47:42 +02:00
|
|
|
- name: Empty motd
|
|
|
|
copy:
|
|
|
|
content: ""
|
|
|
|
dest: /etc/motd
|
|
|
|
mode: "u=rw,g=r,o=r"
|
|
|
|
become: yes
|
|
|
|
notify:
|
|
|
|
- etc changed
|
|
|
|
|
2021-06-26 14:13:05 +02:00
|
|
|
# VPN configuration
|
|
|
|
|
|
|
|
- name: Prepare directory for openvpn-client service override
|
|
|
|
file:
|
|
|
|
path: /etc/systemd/system/openvpn-client@.service.d
|
|
|
|
state: directory
|
|
|
|
mode: "u=rwx,g=rx,o=rx"
|
|
|
|
become: yes
|
|
|
|
|
|
|
|
- name: Make openvpn use hooks for resolvconf
|
|
|
|
copy:
|
|
|
|
src: openvpn-client.service
|
|
|
|
dest: /etc/systemd/system/openvpn-client@.service.d/override.conf
|
|
|
|
become: yes
|
|
|
|
notify:
|
|
|
|
- etc changed
|
|
|
|
- systemd changed
|
|
|
|
|
2022-11-04 14:15:01 +01:00
|
|
|
- name: Disable power button
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/systemd/logind.conf
|
|
|
|
line: 'HandlePowerKey=ignore'
|
|
|
|
regexp: '^#? *HandlePowerKey='
|
|
|
|
insertafter: '^\[Login\]$'
|
|
|
|
become: yes
|
|
|
|
notify: systemd-logind config changed
|
|
|
|
# Reason: I sometimes press it accidentally
|
|
|
|
# (hoping to start it when it's already started,
|
|
|
|
# or really accidentally on the Pinebook).
|
|
|
|
# Suspend would be nice, but it doesn't have the locker then
|
|
|
|
|
2021-06-16 22:57:18 +02:00
|
|
|
# TODO Hibernation, if that's relevant
|
|
|
|
# $ sudo blkid | grep 'TYPE="swap"'
|
|
|
|
# $ sudoedit /etc/default/grub
|
|
|
|
# Add resume=UUID=<UUID-of-swap-partition> to GRUB_CMDLINE_LINUX_DEFAULT
|
|
|
|
# $ sudo grub-mkconfig -o /boot/grub/grub.cfg
|
2021-06-27 21:10:04 +02:00
|
|
|
|
|
|
|
# TODO udevil
|