Migrate Archlinux config from GRUB to systemd-boot

This commit is contained in:
Fabio Scotto di Santolo
2026-05-12 18:33:45 +02:00
parent 22e216e6b1
commit 6a11564b00
3 changed files with 90 additions and 14 deletions

View File

@@ -68,6 +68,7 @@ Ansible-driven personal infrastructure repo for Void/Arch desktops, Linux workst
- `dotfiles/desktop/.local/bin/start-sway-session` - `dotfiles/desktop/.local/bin/start-sway-session`
- Do not auto-restart `emptty` during playbook runs on active Void desktop hosts; restart it manually from another TTY/SSH session if needed. - Do not auto-restart `emptty` during playbook runs on active Void desktop hosts; restart it manually from another TTY/SSH session if needed.
- `nymph` is an Arch GNOME/GDM desktop; do not route it through Void/i3/Sway/emptty tasks. - `nymph` is an Arch GNOME/GDM desktop; do not route it through Void/i3/Sway/emptty tasks.
- `nymph` uses systemd-boot; keep loader entries and kernel cmdline in `ansible/inventory/host_vars/nymph.yml`.
- `profile_desktop_sway` owns the Sway session, Noctalia config rendering, and official plugin linking when a Sway desktop is explicitly enabled. - `profile_desktop_sway` owns the Sway session, Noctalia config rendering, and official plugin linking when a Sway desktop is explicitly enabled.
- Noctalia shared config lives in `dotfiles/desktop/.config/noctalia/`; bar monitors and `screenOverrides` come from inventory (`noctalia_bar_monitors`, `noctalia_screen_overrides`) on Sway hosts. - Noctalia shared config lives in `dotfiles/desktop/.config/noctalia/`; bar monitors and `screenOverrides` come from inventory (`noctalia_bar_monitors`, `noctalia_screen_overrides`) on Sway hosts.
- On Sway hosts, `udiskie` is the backend for automount/LUKS but runs without tray; USB device UI is handled by `usb-drive-manager`. - On Sway hosts, `udiskie` is the backend for automount/LUKS but runs without tray; USB device UI is handled by `usb-drive-manager`.

View File

@@ -7,12 +7,33 @@ desktop_sessions_enabled:
desktop_default_session: gnome desktop_default_session: gnome
desktop_default_session_env: wayland desktop_default_session_env: wayland
host_grub_cmdline_linux: >- host_kernel_cmdline: >-
rd.luks.uuid=1e15d159-5d05-4a1f-9639-ac200dff9f9c rootflags=subvol=@ rd.luks.uuid=1e15d159-5d05-4a1f-9639-ac200dff9f9c rootflags=subvol=@
apparmor=1 security=apparmor nouveau.modeset=0 nvidia-drm.modeset=1 apparmor=1 security=apparmor nouveau.modeset=0 nvidia-drm.modeset=1
host_systemd_boot_esp_path: /boot
host_systemd_boot_default: arch.conf
host_systemd_boot_timeout: 3
host_systemd_boot_console_mode: max
host_systemd_boot_editor: false
host_systemd_boot_entries:
- filename: arch.conf
title: Arch Linux
linux: /vmlinuz-linux
initrds:
- /intel-ucode.img
- /initramfs-linux.img
options: "{{ host_kernel_cmdline }}"
- filename: arch-fallback.conf
title: Arch Linux fallback
linux: /vmlinuz-linux
initrds:
- /intel-ucode.img
- /initramfs-linux-fallback.img
options: "{{ host_kernel_cmdline }}"
host_packages: host_packages:
- grub - intel-ucode
- intel-media-driver - intel-media-driver
- libva-intel-driver - libva-intel-driver
- mesa - mesa

View File

@@ -1,21 +1,75 @@
--- ---
- name: Configure GRUB kernel parameters for NVIDIA hybrid graphics - name: Ensure systemd-boot loader entries directory exists
tags: [packages, nvidia] tags: [packages, nvidia]
ansible.builtin.lineinfile: ansible.builtin.file:
path: /etc/default/grub path: "{{ host_systemd_boot_esp_path }}/loader/entries"
regexp: '^GRUB_CMDLINE_LINUX=' state: directory
line: 'GRUB_CMDLINE_LINUX="{{ host_grub_cmdline_linux }}"' owner: root
state: present group: root
register: nymph_grub_cmdline mode: "0755"
when: host_grub_cmdline_linux is defined when: host_systemd_boot_esp_path is defined
- name: Regenerate GRUB configuration - name: Check whether systemd-boot is installed
tags: [packages, nvidia] tags: [packages, nvidia]
ansible.builtin.command: grub-mkconfig -o /boot/grub/grub.cfg ansible.builtin.command:
argv:
- bootctl
- "--esp-path={{ host_systemd_boot_esp_path }}"
- is-installed
register: nymph_systemd_boot_state
changed_when: false
failed_when: false
when:
- host_systemd_boot_esp_path is defined
- not ansible_check_mode
- name: Install systemd-boot
tags: [packages, nvidia]
ansible.builtin.command:
argv:
- bootctl
- "--esp-path={{ host_systemd_boot_esp_path }}"
- install
changed_when: true changed_when: true
when: when:
- host_grub_cmdline_linux is defined - host_systemd_boot_esp_path is defined
- nymph_grub_cmdline is changed - not ansible_check_mode
- nymph_systemd_boot_state.rc | default(1) != 0
- name: Configure systemd-boot loader defaults
tags: [packages, nvidia]
ansible.builtin.copy:
dest: "{{ host_systemd_boot_esp_path }}/loader/loader.conf"
content: |
default {{ host_systemd_boot_default }}
timeout {{ host_systemd_boot_timeout | default(3) }}
console-mode {{ host_systemd_boot_console_mode | default('max') }}
editor {{ 'yes' if host_systemd_boot_editor | default(false) else 'no' }}
owner: root
group: root
mode: "0644"
when:
- host_systemd_boot_esp_path is defined
- host_systemd_boot_default is defined
- name: Configure systemd-boot Arch entries
tags: [packages, nvidia]
ansible.builtin.copy:
dest: "{{ host_systemd_boot_esp_path }}/loader/entries/{{ item.filename }}"
content: |-
title {{ item.title }}
linux {{ item.linux }}
{% for initrd in item.initrds | default([]) %}
initrd {{ initrd }}
{% endfor %}
options {{ item.options }}
owner: root
group: root
mode: "0644"
loop: "{{ host_systemd_boot_entries | default([]) }}"
loop_control:
label: "{{ item.filename }}"
when: host_systemd_boot_esp_path is defined
- name: Configure NVIDIA power management for hybrid graphics - name: Configure NVIDIA power management for hybrid graphics
tags: [packages, nvidia] tags: [packages, nvidia]