Add users to seat group when seatd is selected#4578
Conversation
When a desktop profile uses seatd for seat access, the user must be in the seat group for the compositor to access input devices. Without this, sway/hyprland/niri/labwc fail to start after installation.
| from archinstall.default_profiles.profile import CustomSetting, DisplayServerType, GreeterType, Profile, ProfileType | ||
|
|
||
| if TYPE_CHECKING: | ||
| from archinstall.lib.installer import Installer |
There was a problem hiding this comment.
why are they in the TYPE_CHECKING scope?
| def provision_seat_access( | ||
| install_session: Installer, | ||
| users: list[User], | ||
| seat_access: str | None, |
There was a problem hiding this comment.
The function itself is pointless if the seat_access is passed as None, the consumers of the function should perform this validation and only call it if it is not None
| return [] | ||
|
|
||
| @override | ||
| def provision(self, install_session: Installer, users: list[User]) -> None: |
There was a problem hiding this comment.
all these profiles essentially implement the same provision logic, instead we can move this into
@override
def provision(self, install_session: Installer, users: list[User]) -> None:
for profile in self.current_selection:
profile.provision(install_session, users)
if seat_access := profile.custom_settings.get(CustomSetting.SeatAccess):
provision_seat_access(install_session, users, seat_access)
The four Wayland profiles (Hyprland, Sway, niri, labwc) each duplicated a provision() override calling provision_seat_access(). Move that into the base DesktopProfile.provision() loop, which already iterates the selected profiles, and read CustomSetting.SeatAccess from each. The None check now lives at the call site (walrus), so provision_seat_access() takes a plain str. This removes the per-profile overrides and their TYPE_CHECKING imports.
|
Thanks @svartkanin! I reworked it so all three are covered at once. The seat-access setup now lives in the base DesktopProfile.provision() instead of being copy-pasted into each Wayland profile, so Hyprland/Sway/niri/labwc lost their duplicated overrides (and with them the TYPE_CHECKING imports). The None check moved to the caller, so the helper just takes a str now. |
| from archinstall.tui.menu_item import MenuItem, MenuItemGroup | ||
| from archinstall.tui.result import ResultType | ||
|
|
||
| if TYPE_CHECKING: |
There was a problem hiding this comment.
Remove the TYPE_CHECKING here
There was a problem hiding this comment.
Oops, missed that one - leftover from the refactor. Fixed.
The Installer and User imports were under a TYPE_CHECKING guard, but they cause no circular import (bspwm.py already imports both at top level). Move them to module scope per review feedback.
Fixes #4471
When seatd is chosen as seat access for sway/hyprland/niri/labwc, the compositor needs the user to be in the seat group to access input devices. Without this, the compositor fails to start after installation.
Verified on real hardware: installed sway + seatd, confirmed seat group was missing from user groups. After the fix, groups test shows seat.
What changed: