Enable new Archlinux profile for nymph

This commit is contained in:
Fabio Scotto di Santolo
2026-05-12 18:02:30 +02:00
parent e4d6deb3c5
commit f0fcc92d6d
20 changed files with 520 additions and 184 deletions

View File

@@ -14,7 +14,7 @@
group: "{{ effective_user_group }}"
mode: "0755"
loop: "{{ xdg_user_directories | default([]) }}"
when: "'void' in group_names"
when: "'desktop' in group_names"
- name: Extract templates kit to Templates directory
tags: [dotfiles, dotfiles:common]
@@ -23,7 +23,7 @@
dest: "{{ effective_user_home }}/Templates"
owner: "{{ effective_username }}"
group: "{{ effective_user_group }}"
when: "'void' in group_names"
when: "'desktop' in group_names"
- name: Ensure SSH socket directory exists
tags: [dotfiles, dotfiles:common]

View File

@@ -0,0 +1,27 @@
---
- name: Synchronize and upgrade Arch Linux packages
tags: [packages]
community.general.pacman:
update_cache: true
upgrade: true
- name: Install packages on Arch Linux
tags: [packages]
community.general.pacman:
name: >-
{{
(
(common_packages | default([]))
+ (arch_packages_base | default([]))
+ (arch_desktop_common_packages | default([]))
+ (
(arch_desktop_gnome_packages | default([]))
if 'gnome' in (desktop_sessions_enabled | default([]))
else []
)
+ (arch_profile_packages | default([]))
+ (host_packages | default([]))
)
| unique
}}
state: present

View File

@@ -5,6 +5,7 @@
changed_when: true
when:
- not ansible_check_mode
- "'void' in group_names"
- desktop_restart_emptty_automatically | default(false)
- name: Report manual emptty restart requirement
@@ -16,10 +17,22 @@
to avoid dropping the active graphical session.
when:
- not ansible_check_mode
- "'void' in group_names"
- not (desktop_restart_emptty_automatically | default(false))
- name: Reload SSH service
- name: Reload SSH service with runit
listen: Reload SSH service
ansible.builtin.command: sv reload sshd
changed_when: true
when: not ansible_check_mode
when:
- not ansible_check_mode
- "'void' in group_names"
- name: Reload SSH service with systemd
listen: Reload SSH service
ansible.builtin.systemd:
name: "{{ desktop_ssh_service_name | default('sshd') }}"
state: reloaded
when:
- not ansible_check_mode
- "'arch' in group_names"

View File

@@ -6,6 +6,7 @@
regexp: '^#?HandleLidSwitch='
line: 'HandleLidSwitch=suspend'
state: present
when: "'void' in group_names"
- name: Ensure common config directories exist
tags: [dotfiles, dotfiles:desktop]
@@ -22,6 +23,9 @@
- "{{ user_home }}/.config/alacritty"
- "{{ user_home }}/.config/Thunar"
- "{{ user_home }}/.config/rofi"
- "{{ user_home }}/.config/systemd"
- "{{ user_home }}/.config/systemd/user"
- "{{ user_home }}/.bashrc.d"
- "{{ user_home }}/.tmux"
- "{{ user_home }}/.tmux/bin"
- "{{ user_home }}/.tmux/plugins"
@@ -42,6 +46,7 @@
insertafter: '^auth\s+include\s+system-local-login$'
line: "auth optional pam_gnome_keyring.so"
state: present
when: "'void' in group_names"
- name: Enable gnome-keyring PAM session hook
tags: [packages, gnome]
@@ -50,6 +55,7 @@
insertafter: '^session\s+include\s+system-local-login$'
line: "session optional pam_gnome_keyring.so auto_start"
state: present
when: "'void' in group_names"
- name: Enable gnome-keyring PAM password hook
tags: [packages, gnome]
@@ -58,6 +64,7 @@
insertafter: '^password\s+include\s+system-local-login$'
line: "password optional pam_gnome_keyring.so use_authtok"
state: present
when: "'void' in group_names"
- name: Check whether SSH host ed25519 key exists
tags: [services]
@@ -181,6 +188,7 @@
ansible.builtin.stat:
path: /etc/sv/libvirtd
register: libvirtd_service_dir
when: "'void' in group_names"
- name: Enable libvirt daemon service
tags: [packages, services]
@@ -188,7 +196,9 @@
src: /etc/sv/libvirtd
dest: /var/service/libvirtd
state: link
when: libvirtd_service_dir.stat.exists
when:
- "'void' in group_names"
- libvirtd_service_dir.stat.exists
- name: Check virtualization group availability
tags: [packages]
@@ -229,6 +239,7 @@
owner: root
group: root
mode: "0755"
when: "'void' in group_names"
- name: Ensure emptty session directories exist
tags: [packages, services, emptty]
@@ -241,6 +252,7 @@
loop:
- /etc/emptty/xsessions
- /etc/emptty/wayland-sessions
when: "'void' in group_names"
- name: Configure emptty
tags: [packages, services, emptty]
@@ -251,6 +263,7 @@
group: root
mode: "0644"
notify: Restart emptty
when: "'void' in group_names"
- name: Copy common desktop dotfiles
tags: [dotfiles, dotfiles:desktop]
@@ -260,10 +273,41 @@
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "{{ item.mode }}"
loop: "{{ desktop_common_dotfiles | default([]) }}"
loop: >-
{{
(desktop_common_dotfiles | default([]))
+ ((desktop_void_dotfiles | default([])) if 'void' in group_names else [])
+ ((desktop_arch_dotfiles | default([])) if 'arch' in group_names else [])
}}
loop_control:
label: "{{ item.dest }}"
- name: Ensure systemd user enablement directory exists
tags: [services, dotfiles, dotfiles:desktop]
ansible.builtin.file:
path: "{{ user_home }}/.config/systemd/user/default.target.wants"
state: directory
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "0755"
when:
- "'arch' in group_names"
- (desktop_systemd_user_services | default([])) | length > 0
- name: Enable desktop systemd user services
tags: [services, dotfiles, dotfiles:desktop]
ansible.builtin.file:
src: "{{ user_home }}/.config/systemd/user/{{ item }}"
dest: "{{ user_home }}/.config/systemd/user/default.target.wants/{{ item }}"
state: link
owner: "{{ username }}"
group: "{{ user_group }}"
force: true
loop: "{{ desktop_systemd_user_services | default([]) }}"
loop_control:
label: "{{ item }}"
when: "'arch' in group_names"
- name: Copy Emacs desktop dotfiles
tags: [dotfiles, dotfiles:desktop, emacs]
ansible.builtin.copy:

View File

@@ -0,0 +1,18 @@
---
- name: Ensure GNOME desktop session is enabled for this profile
tags: [gnome]
ansible.builtin.assert:
that:
- "'gnome' in (desktop_sessions_enabled | default([]))"
fail_msg: >-
profile_desktop_gnome requires desktop_sessions_enabled to include gnome.
- name: Ensure systemd boots to the graphical target
tags: [services, gnome]
ansible.builtin.file:
src: /usr/lib/systemd/system/graphical.target
dest: /etc/systemd/system/default.target
state: link
force: true
owner: root
group: root

View File

@@ -4,13 +4,18 @@
ansible.builtin.lineinfile:
path: /etc/default/grub
regexp: '^GRUB_CMDLINE_LINUX='
line: 'GRUB_CMDLINE_LINUX="rd.luks.uuid=1e15d159-5d05-4a1f-9639-ac200dff9f9c rootflags=subvol=@ apparmor=1 security=apparmor nouveau.modeset=0 nvidia-drm.modeset=1"'
line: 'GRUB_CMDLINE_LINUX="{{ host_grub_cmdline_linux }}"'
state: present
register: nymph_grub_cmdline
when: host_grub_cmdline_linux is defined
- name: Regenerate GRUB configuration
tags: [packages, nvidia]
ansible.builtin.command: grub-mkconfig -o /boot/grub/grub.cfg
changed_when: true
when:
- host_grub_cmdline_linux is defined
- nymph_grub_cmdline is changed
- name: Configure NVIDIA power management for hybrid graphics
tags: [packages, nvidia]