Skip to content
Merged
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: 4 additions & 2 deletions archinstall/applications/audio.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from typing import TYPE_CHECKING

from archinstall.lib.hardware import SysInfo
Expand Down Expand Up @@ -30,7 +32,7 @@ def pipewire_packages(self) -> list[str]:

def _enable_pipewire(
self,
install_session: 'Installer',
install_session: Installer,
users: list['User'] | None = None,
) -> None:
if users is None:
Expand All @@ -56,7 +58,7 @@ def _enable_pipewire(

def install(
self,
install_session: 'Installer',
install_session: Installer,
audio_config: AudioConfiguration,
users: list[User] | None = None,
) -> None:
Expand Down
4 changes: 3 additions & 1 deletion archinstall/applications/bluetooth.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from typing import TYPE_CHECKING

from archinstall.lib.output import debug
Expand All @@ -20,7 +22,7 @@ def services(self) -> list[str]:
'bluetooth.service',
]

def install(self, install_session: 'Installer') -> None:
def install(self, install_session: Installer) -> None:
debug('Installing Bluetooth')
install_session.add_additional_packages(self.packages)
install_session.enable_service(self.services)
4 changes: 3 additions & 1 deletion archinstall/applications/firewall.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from typing import TYPE_CHECKING

from archinstall.lib.models.application import Firewall, FirewallConfiguration
Expand Down Expand Up @@ -34,7 +36,7 @@ def fwd_services(self) -> list[str]:

def install(
self,
install_session: 'Installer',
install_session: Installer,
firewall_config: FirewallConfiguration,
) -> None:
debug(f'Installing firewall: {firewall_config.firewall.value}')
Expand Down
4 changes: 3 additions & 1 deletion archinstall/applications/power_management.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from typing import TYPE_CHECKING

from archinstall.lib.models.application import PowerManagement, PowerManagementConfiguration
Expand All @@ -23,7 +25,7 @@ def tuned_packages(self) -> list[str]:

def install(
self,
install_session: 'Installer',
install_session: Installer,
power_management_config: PowerManagementConfiguration,
) -> None:
debug(f'Installing power management daemon: {power_management_config.power_management.value}')
Expand Down
4 changes: 3 additions & 1 deletion archinstall/applications/print_service.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from typing import TYPE_CHECKING

from archinstall.lib.output import debug
Expand All @@ -17,7 +19,7 @@ def services(self) -> list[str]:
'cups.service',
]

def install(self, install_session: 'Installer') -> None:
def install(self, install_session: Installer) -> None:
debug('Installing print service')
install_session.add_additional_packages(self.packages)
install_session.enable_service(self.services)
6 changes: 4 additions & 2 deletions archinstall/default_profiles/custom.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# from __future__ import annotations
#
# from typing import List, Dict, Optional, TYPE_CHECKING, Any
#
# from ..lib import menu
Expand Down Expand Up @@ -157,11 +159,11 @@
#
# return SelectResult.NewSelection
#
# def post_install(self, install_session: 'Installer'):
# def post_install(self, install_session: Installer):
# for profile in self._current_selection:
# profile.post_install(install_session)
#
# def install(self, install_session: 'Installer'):
# def install(self, install_session: Installer):
# driver_packages = self.gfx_driver_packages()
# install_session.add_additional_packages(driver_packages)
#
Expand Down
6 changes: 4 additions & 2 deletions archinstall/default_profiles/desktop.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Self, override

from archinstall.default_profiles.profile import GreeterType, Profile, ProfileType, SelectResult
Expand Down Expand Up @@ -89,12 +91,12 @@ def do_on_select(self) -> SelectResult:
return SelectResult.ResetCurrent

@override
def post_install(self, install_session: 'Installer') -> None:
def post_install(self, install_session: Installer) -> None:
for profile in self.current_selection:
profile.post_install(install_session)

@override
def install(self, install_session: 'Installer') -> None:
def install(self, install_session: Installer) -> None:
# Install common packages for all desktop environments
install_session.add_additional_packages(self.packages)

Expand Down
4 changes: 3 additions & 1 deletion archinstall/default_profiles/desktops/awesome.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from typing import TYPE_CHECKING, override

from archinstall.default_profiles.profile import ProfileType
Expand Down Expand Up @@ -29,7 +31,7 @@ def packages(self) -> list[str]:
]

@override
def install(self, install_session: 'Installer') -> None:
def install(self, install_session: Installer) -> None:
super().install(install_session)

# TODO: Copy a full configuration to ~/.config/awesome/rc.lua instead.
Expand Down
4 changes: 2 additions & 2 deletions archinstall/default_profiles/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ def _advanced_check(self) -> bool:

return self.advanced is False or arch_config_handler.args.advanced is True

def install(self, install_session: 'Installer') -> None:
def install(self, install_session: Installer) -> None:
"""
Performs installation steps when this profile was selected
"""

def post_install(self, install_session: 'Installer') -> None:
def post_install(self, install_session: Installer) -> None:
"""
Hook that will be called when the installation process is
finished and custom installation steps for specific default_profiles
Expand Down
6 changes: 4 additions & 2 deletions archinstall/default_profiles/server.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Self, override

from archinstall.default_profiles.profile import Profile, ProfileType, SelectResult
Expand Down Expand Up @@ -55,12 +57,12 @@ def do_on_select(self) -> SelectResult:
return SelectResult.ResetCurrent

@override
def post_install(self, install_session: 'Installer') -> None:
def post_install(self, install_session: Installer) -> None:
for profile in self.current_selection:
profile.post_install(install_session)

@override
def install(self, install_session: 'Installer') -> None:
def install(self, install_session: Installer) -> None:
server_info = self.current_selection_names()
details = ', '.join(server_info)
info(f'Now installing the selected servers: {details}')
Expand Down
4 changes: 3 additions & 1 deletion archinstall/default_profiles/servers/docker.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from typing import TYPE_CHECKING, override

from archinstall.default_profiles.profile import Profile, ProfileType
Expand All @@ -24,7 +26,7 @@ def services(self) -> list[str]:
return ['docker']

@override
def post_install(self, install_session: 'Installer') -> None:
def post_install(self, install_session: Installer) -> None:
from archinstall.lib.args import arch_config_handler

if auth_config := arch_config_handler.config.auth_config:
Expand Down
4 changes: 3 additions & 1 deletion archinstall/default_profiles/servers/mariadb.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from typing import TYPE_CHECKING, override

from archinstall.default_profiles.profile import Profile, ProfileType
Expand All @@ -24,5 +26,5 @@ def services(self) -> list[str]:
return ['mariadb']

@override
def post_install(self, install_session: 'Installer') -> None:
def post_install(self, install_session: Installer) -> None:
install_session.arch_chroot('mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql')
4 changes: 3 additions & 1 deletion archinstall/default_profiles/servers/postgresql.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from typing import TYPE_CHECKING, override

from archinstall.default_profiles.profile import Profile, ProfileType
Expand All @@ -24,5 +26,5 @@ def services(self) -> list[str]:
return ['postgresql']

@override
def post_install(self, install_session: 'Installer') -> None:
def post_install(self, install_session: Installer) -> None:
install_session.arch_chroot('initdb -D /var/lib/postgres/data', run_as='postgres')
4 changes: 3 additions & 1 deletion archinstall/lib/applications/application_handler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from typing import TYPE_CHECKING

from archinstall.applications.audio import AudioApp
Expand All @@ -17,7 +19,7 @@ class ApplicationHandler:
def __init__(self) -> None:
pass

def install_applications(self, install_session: 'Installer', app_config: ApplicationConfiguration, users: list['User'] | None = None) -> None:
def install_applications(self, install_session: Installer, app_config: ApplicationConfiguration, users: list['User'] | None = None) -> None:
if app_config.bluetooth_config and app_config.bluetooth_config.enabled:
BluetoothApp().install(install_session)

Expand Down
10 changes: 6 additions & 4 deletions archinstall/lib/authentication/authentication_handler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import getpass
from pathlib import Path
from typing import TYPE_CHECKING
Expand All @@ -16,20 +18,20 @@
class AuthenticationHandler:
def setup_auth(
self,
install_session: 'Installer',
install_session: Installer,
auth_config: AuthenticationConfiguration,
hostname: str,
) -> None:
if auth_config.u2f_config and auth_config.users is not None:
self._setup_u2f_login(install_session, auth_config.u2f_config, auth_config.users, hostname)

def _setup_u2f_login(self, install_session: 'Installer', u2f_config: U2FLoginConfiguration, users: list[User], hostname: str) -> None:
def _setup_u2f_login(self, install_session: Installer, u2f_config: U2FLoginConfiguration, users: list[User], hostname: str) -> None:
self._configure_u2f_mapping(install_session, u2f_config, users, hostname)
self._update_pam_config(install_session, u2f_config)

def _update_pam_config(
self,
install_session: 'Installer',
install_session: Installer,
u2f_config: U2FLoginConfiguration,
) -> None:
match u2f_config.u2f_login_method:
Expand Down Expand Up @@ -73,7 +75,7 @@ def _add_u2f_entry(self, file: Path, entry: str) -> None:

def _configure_u2f_mapping(
self,
install_session: 'Installer',
install_session: Installer,
u2f_config: U2FLoginConfiguration,
users: list[User],
hostname: str,
Expand Down
8 changes: 5 additions & 3 deletions archinstall/lib/profile/profiles_handler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import importlib.util
import inspect
import sys
Expand Down Expand Up @@ -171,7 +173,7 @@ def get_desktop_profiles(self) -> list[Profile]:
def get_custom_profiles(self) -> list[Profile]:
return [p for p in self.profiles if p.is_custom_type_profile()]

def install_greeter(self, install_session: 'Installer', greeter: GreeterType) -> None:
def install_greeter(self, install_session: Installer, greeter: GreeterType) -> None:
packages = []
service = None
service_disable = None
Expand Down Expand Up @@ -215,7 +217,7 @@ def install_greeter(self, install_session: 'Installer', greeter: GreeterType) ->
with open(path, 'w') as file:
file.write(filedata)

def install_gfx_driver(self, install_session: 'Installer', driver: GfxDriver) -> None:
def install_gfx_driver(self, install_session: Installer, driver: GfxDriver) -> None:
debug(f'Installing GFX driver: {driver.value}')

if driver in [GfxDriver.NvidiaOpenKernel, GfxDriver.NvidiaProprietary]:
Expand All @@ -227,7 +229,7 @@ def install_gfx_driver(self, install_session: 'Installer', driver: GfxDriver) ->
pkg_names = [p.value for p in driver_pkgs]
install_session.add_additional_packages(pkg_names)

def install_profile_config(self, install_session: 'Installer', profile_config: ProfileConfiguration) -> None:
def install_profile_config(self, install_session: Installer, profile_config: ProfileConfiguration) -> None:
profile = profile_config.profile

if not profile:
Expand Down