Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions archinstall/default_profiles/desktop.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

if TYPE_CHECKING:
from archinstall.lib.installer import Installer
from archinstall.lib.models.users import User


class DesktopProfile(Profile):
Expand Down Expand Up @@ -88,6 +89,11 @@ def post_install(self, install_session: Installer) -> None:
for profile in self.current_selection:
profile.post_install(install_session)

@override
def provision(self, install_session: Installer, users: list[User]) -> None:
for profile in self.current_selection:
profile.provision(install_session, users)

@override
def install(self, install_session: Installer) -> None:
# Install common packages for all desktop environments
Expand Down
14 changes: 13 additions & 1 deletion archinstall/default_profiles/desktops/bspwm.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
from typing import override
from typing import TYPE_CHECKING, override

from archinstall.default_profiles.profile import DisplayServerType, GreeterType, Profile, ProfileType

if TYPE_CHECKING:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are they behind a type check?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand - python 3.14 evaluates annotations lazily (PEP 649), so Installer and User are never resolved at runtime - they're only used by type checkers. TYPE_CHECKING avoids importing heavy modules (Installer pulls in a lot) and sidesteps potential circular imports.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there actual circular deps? If not we shouls define these as regular imports

from archinstall.lib.installer import Installer
from archinstall.lib.models.users import User


class BspwmProfile(Profile):
def __init__(self) -> None:
Expand All @@ -27,3 +31,11 @@ def packages(self) -> list[str]:
@override
def default_greeter_type(self) -> GreeterType:
return GreeterType.Lightdm

@override
def provision(self, install_session: Installer, users: list[User]) -> None:
for user in users:
install_session.arch_chroot('mkdir -p ~/.config/bspwm ~/.config/sxhkd', run_as=user.username)
install_session.arch_chroot('cp /usr/share/doc/bspwm/examples/bspwmrc ~/.config/bspwm/', run_as=user.username)
install_session.arch_chroot('cp /usr/share/doc/bspwm/examples/sxhkdrc ~/.config/sxhkd/', run_as=user.username)
install_session.arch_chroot('chmod +x ~/.config/bspwm/bspwmrc', run_as=user.username)