index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
diff --git a/profiles/52-54-00-12-34-56.py b/profiles/52-54-00-12-34-56.py index a3347760..68e15720 100644 --- a/profiles/52-54-00-12-34-56.py +++ b/profiles/52-54-00-12-34-56.py @@ -1,13 +1,14 @@ import archinstall -import json -import urllib.request + +# import json +# import urllib.request __packages__ = ['nano', 'wget', 'git'] if __name__ == '52-54-00-12-34-56': - awesome = archinstall.Application(installation, 'postgresql') + awesome = archinstall.Application(archinstall.storage['installation_session'], 'postgresql') awesome.install() - + """ # Unmount and close previous runs (Mainly only used for re-runs, but won't hurt.) archinstall.sys_command(f'umount -R /mnt', suppress_errors=True) @@ -22,12 +23,12 @@ with archinstall.Filesystem(harddrive) as fs: fs.use_entire_disk('luks2') if harddrive.partition[1].size == '512M': - raise OSError('Trying to encrypt the boot partition for petes sake..') + raise OSError('Trying to encrypt the boot partition for Pete's sake..') harddrive.partition[0].format('fat32') with archinstall.luks2(harddrive.partition[1], 'luksloop', disk_password) as unlocked_device: unlocked_device.format('btrfs') - + with archinstall.Installer( unlocked_device, boot_partition=harddrive.partition[0], @@ -57,4 +58,4 @@ with archinstall.Filesystem(harddrive) as fs: urllib.request.urlopen(req, timeout=5) except: pass -"""
\ No newline at end of file +""" diff --git a/profiles/__init__.py b/profiles/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/profiles/__init__.py diff --git a/profiles/applications/__init__.py b/profiles/applications/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/profiles/applications/__init__.py diff --git a/profiles/applications/awesome.py b/profiles/applications/awesome.py index a63c707b..33526fd7 100644 --- a/profiles/applications/awesome.py +++ b/profiles/applications/awesome.py @@ -1,12 +1,22 @@ import archinstall -__packages__ = ["awesome", "xorg-xrandr", "xterm", "feh", "slock", "terminus-font", "gnu-free-fonts", "ttf-liberation", "xsel"] +__packages__ = [ + "awesome", + "xorg-xrandr", + "xterm", + "feh", + "slock", + "terminus-font", + "gnu-free-fonts", + "ttf-liberation", + "xsel", +] -installation.install_profile('xorg') +archinstall.storage['installation_session'].install_profile('xorg') -installation.add_additional_packages(__packages__) +archinstall.storage['installation_session'].add_additional_packages(__packages__) -with open(f'{installation.target}/etc/X11/xinit/xinitrc', 'r') as xinitrc: +with open(f"{archinstall.storage['installation_session'].target}/etc/X11/xinit/xinitrc", 'r') as xinitrc: xinitrc_data = xinitrc.read() for line in xinitrc_data.split('\n'): @@ -20,5 +30,5 @@ for line in xinitrc_data.split('\n'): xinitrc_data += '\n' xinitrc_data += 'exec awesome\n' -with open(f'{installation.target}/etc/X11/xinit/xinitrc', 'w') as xinitrc: +with open(f"{archinstall.storage['installation_session'].target}/etc/X11/xinit/xinitrc", 'w') as xinitrc: xinitrc.write(xinitrc_data) diff --git a/profiles/applications/cockpit.py b/profiles/applications/cockpit.py new file mode 100644 index 00000000..d8aa0fd1 --- /dev/null +++ b/profiles/applications/cockpit.py @@ -0,0 +1,13 @@ +import archinstall + +# Define the package list in order for lib to source +# which packages will be installed by this profile +__packages__ = [ + "cockpit", + "udisks2", + "packagekit", +] + +archinstall.storage['installation_session'].add_additional_packages(__packages__) + +archinstall.storage['installation_session'].enable_service('cockpit.socket') diff --git a/profiles/applications/docker.py b/profiles/applications/docker.py index afa3f8fb..afbde1a5 100644 --- a/profiles/applications/docker.py +++ b/profiles/applications/docker.py @@ -4,6 +4,6 @@ import archinstall # which packages will be installed by this profile __packages__ = ["docker"] -installation.add_additional_packages(__packages__) +archinstall.storage['installation_session'].add_additional_packages(__packages__) -installation.enable_service('docker') +archinstall.storage['installation_session'].enable_service('docker') diff --git a/profiles/applications/httpd.py b/profiles/applications/httpd.py index 00d64b6e..23b3fefa 100644 --- a/profiles/applications/httpd.py +++ b/profiles/applications/httpd.py @@ -4,6 +4,6 @@ import archinstall # which packages will be installed by this profile __packages__ = ["apache"] -installation.add_additional_packages(__packages__) +archinstall.storage['installation_session'].add_additional_packages(__packages__) -installation.enable_service('httpd') +archinstall.storage['installation_session'].enable_service('httpd') diff --git a/profiles/applications/lighttpd.py b/profiles/applications/lighttpd.py index a1e6a371..71158861 100644 --- a/profiles/applications/lighttpd.py +++ b/profiles/applications/lighttpd.py @@ -4,6 +4,6 @@ import archinstall # which packages will be installed by this profile __packages__ = ["lighttpd"] -installation.add_additional_packages(__packages__) +archinstall.storage['installation_session'].add_additional_packages(__packages__) -installation.enable_service('lighttpd') +archinstall.storage['installation_session'].enable_service('lighttpd') diff --git a/profiles/applications/mariadb.py b/profiles/applications/mariadb.py index e458a45a..bdde18b5 100644 --- a/profiles/applications/mariadb.py +++ b/profiles/applications/mariadb.py @@ -4,8 +4,8 @@ import archinstall # which packages will be installed by this profile __packages__ = ["mariadb"] -installation.add_additional_packages(__packages__) +archinstall.storage['installation_session'].add_additional_packages(__packages__) -installation.arch_chroot("mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql") +archinstall.storage['installation_session'].arch_chroot("mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql") -installation.enable_service('mariadb') +archinstall.storage['installation_session'].enable_service('mariadb') diff --git a/profiles/applications/nginx.py b/profiles/applications/nginx.py index 50eb0506..6f63b15c 100644 --- a/profiles/applications/nginx.py +++ b/profiles/applications/nginx.py @@ -4,6 +4,6 @@ import archinstall # which packages will be installed by this profile __packages__ = ["nginx"] -installation.add_additional_packages(__packages__) +archinstall.storage['installation_session'].add_additional_packages(__packages__) -installation.enable_service('nginx') +archinstall.storage['installation_session'].enable_service('nginx') diff --git a/profiles/applications/postgresql.py b/profiles/applications/postgresql.py index fcdce824..29546d78 100644 --- a/profiles/applications/postgresql.py +++ b/profiles/applications/postgresql.py @@ -4,8 +4,8 @@ import archinstall # which packages will be installed by this profile __packages__ = ["postgresql"] -installation.add_additional_packages(__packages__) +archinstall.storage['installation_session'].add_additional_packages(__packages__) -installation.arch_chroot("initdb -D /var/lib/postgres/data", runas='postgres') +archinstall.storage['installation_session'].arch_chroot("initdb -D /var/lib/postgres/data", runas='postgres') -installation.enable_service('postgresql')
\ No newline at end of file +archinstall.storage['installation_session'].enable_service('postgresql') diff --git a/profiles/applications/sshd.py b/profiles/applications/sshd.py new file mode 100644 index 00000000..4199ecb0 --- /dev/null +++ b/profiles/applications/sshd.py @@ -0,0 +1,9 @@ +import archinstall + +# Define the package list in order for lib to source +# which packages will be installed by this profile +__packages__ = ["openssh"] + +archinstall.storage['installation_session'].add_additional_packages(__packages__) + +archinstall.storage['installation_session'].enable_service('sshd') diff --git a/profiles/applications/tomcat.py b/profiles/applications/tomcat.py index 9c521390..ae6d1c2a 100644 --- a/profiles/applications/tomcat.py +++ b/profiles/applications/tomcat.py @@ -7,6 +7,6 @@ import archinstall # which packages will be installed by this profile __packages__ = ["tomcat10"] -installation.add_additional_packages(__packages__) +archinstall.storage['installation_session'].add_additional_packages(__packages__) -installation.enable_service('tomcat10') +archinstall.storage['installation_session'].enable_service('tomcat10') diff --git a/profiles/awesome.py b/profiles/awesome.py index a5dedccd..9648fc4a 100644 --- a/profiles/awesome.py +++ b/profiles/awesome.py @@ -6,7 +6,13 @@ is_top_level_profile = False # New way of defining packages for a profile, which is iterable and can be used out side # of the profile to get a list of "what packages will be installed". -__packages__ = ['nemo', 'gpicview-gtk3', 'main', 'alacritty'] +__packages__ = [ + "nemo", + "gpicview", + "maim", + "alacritty", +] + def _prep_function(*args, **kwargs): """ @@ -30,23 +36,23 @@ def _prep_function(*args, **kwargs): # or through conventional import awesome if __name__ == 'awesome': # Install the application awesome from the template under /applications/ - awesome = archinstall.Application(installation, 'awesome') + awesome = archinstall.Application(archinstall.storage['installation_session'], 'awesome') awesome.install() - installation.add_additional_packages(__packages__) + archinstall.storage['installation_session'].add_additional_packages(__packages__) # TODO: Copy a full configuration to ~/.config/awesome/rc.lua instead. - with open(f'{installation.target}/etc/xdg/awesome/rc.lua', 'r') as fh: + with open(f"{archinstall.storage['installation_session'].target}/etc/xdg/awesome/rc.lua", 'r') as fh: awesome_lua = fh.read() - ## Replace xterm with alacritty for a smoother experience. + # Replace xterm with alacritty for a smoother experience. awesome_lua = awesome_lua.replace('"xterm"', '"alacritty"') - with open(f'{installation.target}/etc/xdg/awesome/rc.lua', 'w') as fh: + with open(f"{archinstall.storage['installation_session'].target}/etc/xdg/awesome/rc.lua", 'w') as fh: fh.write(awesome_lua) - ## TODO: Configure the right-click-menu to contain the above packages that were installed. (as a user config) - - ## Remove some interfering nemo settings - installation.arch_chroot("gsettings set org.nemo.desktop show-desktop-icons false") - installation.arch_chroot("xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search") + # TODO: Configure the right-click-menu to contain the above packages that were installed. (as a user config) + + # Remove some interfering nemo settings + archinstall.storage['installation_session'].arch_chroot("gsettings set org.nemo.desktop show-desktop-icons false") + archinstall.storage['installation_session'].arch_chroot("xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search") diff --git a/profiles/budgie.py b/profiles/budgie.py index fc061cd2..3e4a85df 100644 --- a/profiles/budgie.py +++ b/profiles/budgie.py @@ -4,8 +4,14 @@ import archinstall is_top_level_profile = False -# "It is recommended also to install the gnome group, which contains applications required for the standard GNOME experience." - Arch Wiki -__packages__ = ["budgie-desktop", "lightdm", "lightdm-gtk-greeter", "gnome"] +# "It is recommended also to install the gnome group, which contains applications required for the standard GNOME experience." - Arch Wiki +__packages__ = [ + "budgie-desktop", + "gnome", + "lightdm", + "lightdm-gtk-greeter", +] + def _prep_function(*args, **kwargs): """ @@ -23,14 +29,15 @@ def _prep_function(*args, **kwargs): else: print('Deprecated (??): xorg profile has no _prep_function() anymore') + # Ensures that this code only gets executed if executed # through importlib.util.spec_from_file_location("budgie", "/somewhere/budgie.py") # or through conventional import budgie if __name__ == 'budgie': # Install dependency profiles - installation.install_profile('xorg') + archinstall.storage['installation_session'].install_profile('xorg') # Install the Budgie packages - installation.add_additional_packages(__packages__) + archinstall.storage['installation_session'].add_additional_packages(__packages__) - installation.enable_service('lightdm') # Light Display Manager + archinstall.storage['installation_session'].enable_service('lightdm') # Light Display Manager diff --git a/profiles/cinnamon.py b/profiles/cinnamon.py index 4ca9cfed..0122677a 100644 --- a/profiles/cinnamon.py +++ b/profiles/cinnamon.py @@ -4,7 +4,17 @@ import archinstall is_top_level_profile = False -__packages__ = ["cinnamon", "system-config-printer", "gnome-keyring", "gnome-terminal", "blueberry", "metacity", "lightdm", "lightdm-gtk-greeter"] +__packages__ = [ + "cinnamon", + "system-config-printer", + "gnome-keyring", + "gnome-terminal", + "blueberry", + "metacity", + "lightdm", + "lightdm-gtk-greeter", +] + def _prep_function(*args, **kwargs): """ @@ -22,14 +32,15 @@ def _prep_function(*args, **kwargs): else: print('Deprecated (??): xorg profile has no _prep_function() anymore') + # Ensures that this code only gets executed if executed # through importlib.util.spec_from_file_location("cinnamon", "/somewhere/cinnamon.py") # or through conventional import cinnamon if __name__ == 'cinnamon': # Install dependency profiles - installation.install_profile('xorg') + archinstall.storage['installation_session'].install_profile('xorg') # Install the Cinnamon packages - installation.add_additional_packages(__packages__) + archinstall.storage['installation_session'].add_additional_packages(__packages__) - installation.enable_service('lightdm') # Light Display Manager + archinstall.storage['installation_session'].enable_service('lightdm') # Light Display Manager diff --git a/profiles/deepin.py b/profiles/deepin.py index ce59a699..5bc18285 100644 --- a/profiles/deepin.py +++ b/profiles/deepin.py @@ -1,10 +1,17 @@ # A desktop environment using "Deepin". -import archinstall, os +import archinstall is_top_level_profile = False -__packages__ = ["deepin", "deepin-terminal", "deepin-editor"] +__packages__ = [ + "deepin", + "deepin-terminal", + "deepin-editor", + "lightdm", + "lightdm-gtk-greeter", +] + def _prep_function(*args, **kwargs): """ @@ -28,10 +35,10 @@ def _prep_function(*args, **kwargs): # or through conventional import deepin if __name__ == 'deepin': # Install dependency profiles - installation.install_profile('xorg') + archinstall.storage['installation_session'].install_profile('xorg') # Install the Deepin packages - installation.add_additional_packages(__packages__) + archinstall.storage['installation_session'].add_additional_packages(__packages__) # Enable autostart of Deepin for all users - installation.enable_service('lightdm') + archinstall.storage['installation_session'].enable_service('lightdm') diff --git a/profiles/desktop.py b/profiles/desktop.py index 2aea6d30..631c7f76 100644 --- a/profiles/desktop.py +++ b/profiles/desktop.py @@ -1,12 +1,24 @@ # A desktop environment selector. -import archinstall, os +import archinstall is_top_level_profile = True # New way of defining packages for a profile, which is iterable and can be used out side # of the profile to get a list of "what packages will be installed". -__packages__ = ['nano', 'vim', 'openssh', 'htop', 'wget', 'iwd', 'wireless_tools', 'wpa_supplicant', 'smartmontools', 'xdg-utils'] +__packages__ = [ + 'nano', + 'vim', + 'openssh', + 'htop', + 'wget', + 'iwd', + 'wireless_tools', + 'wpa_supplicant', + 'smartmontools', + 'xdg-utils', +] + def _prep_function(*args, **kwargs): """ @@ -16,14 +28,28 @@ def _prep_function(*args, **kwargs): for more input before any other installer steps start. """ - supported_desktops = ['gnome', 'kde', 'awesome', 'sway', 'cinnamon', 'xfce4', 'lxqt', 'i3', 'budgie', 'mate'] - desktop = archinstall.generic_select(supported_desktops, 'Select your desired desktop environment: ', - allow_empty_input=False, sort=True) - + supported_desktops = [ + 'gnome', + 'kde', + 'awesome', + 'sway', + 'cinnamon', + 'xfce4', + 'lxqt', + 'i3', + 'budgie', + 'mate', + 'deepin', + 'enlightenment', + ] + + desktop = archinstall.generic_select(supported_desktops, 'Select your desired desktop environment: ', allow_empty_input=False, sort=True) + # Temporarily store the selected desktop profile # in a session-safe location, since this module will get reloaded # the next time it gets executed. - archinstall.storage['_desktop_profile'] = desktop + if '_desktop_profile' not in archinstall.storage.keys(): + archinstall.storage['_desktop_profile'] = desktop profile = archinstall.Profile(None, desktop) # Loading the instructions with a custom namespace, ensures that a __name__ comparison is never triggered. @@ -33,6 +59,7 @@ def _prep_function(*args, **kwargs): else: print(f"Deprecated (??): {desktop} profile has no _prep_function() anymore") + if __name__ == 'desktop': """ This "profile" is a meta-profile. @@ -46,11 +73,8 @@ if __name__ == 'desktop': There are plenty of desktop-turn-key-solutions based on Arch Linux, this is therefore just a helper to get started """ - - # Install common packages for all desktop environments - installation.add_additional_packages(__packages__) - # TODO: Remove magic variable 'installation' and place it - # in archinstall.storage or archinstall.session/archinstall.installation - installation.install_profile(archinstall.storage['_desktop_profile']) + # Install common packages for all desktop environments + archinstall.storage['installation_session'].add_additional_packages(__packages__) + archinstall.storage['installation_session'].install_profile(archinstall.storage['_desktop_profile']) diff --git a/profiles/enlightenment.py b/profiles/enlightenment.py new file mode 100644 index 00000000..3850fed0 --- /dev/null +++ b/profiles/enlightenment.py @@ -0,0 +1,43 @@ +# A desktop environment using "Enlightenment". + +import archinstall + +is_top_level_profile = False + +__packages__ = [ + "enlightenment", + "terminology", + "lightdm", + "lightdm-gtk-greeter", +] + + +def _prep_function(*args, **kwargs): + """ + Magic function called by the importing installer + before continuing any further. It also avoids executing any + other code in this stage. So it's a safe way to ask the user + for more input before any other installer steps start. + """ + + # Enlightenment requires a functioning Xorg installation. + profile = archinstall.Profile(None, 'xorg') + with profile.load_instructions(namespace='xorg.py') as imported: + if hasattr(imported, '_prep_function'): + return imported._prep_function() + else: + print('Deprecated (??): xorg profile has no _prep_function() anymore') + + +# Ensures that this code only gets executed if executed +# through importlib.util.spec_from_file_location("enlightenment", "/somewhere/enlightenment.py") +# or through conventional import enlightenment +if __name__ == 'enlightenment': + # Install dependency profiles + archinstall.storage['installation_session'].install_profile('xorg') + + # Install the enlightenment packages + archinstall.storage['installation_session'].add_additional_packages(__packages__) + + # Enable autostart of enlightenment for all users + archinstall.storage['installation_session'].enable_service('lightdm') diff --git a/profiles/gnome.py b/profiles/gnome.py index 77c90859..1b3bf327 100644 --- a/profiles/gnome.py +++ b/profiles/gnome.py @@ -5,7 +5,12 @@ import archinstall is_top_level_profile = False # Note: GDM should be part of the gnome group, but adding it here for clarity -__packages__ = ["gnome", "gnome-tweaks", "gdm"] +__packages__ = [ + "gnome", + "gnome-tweaks", + "gdm", +] + def _prep_function(*args, **kwargs): """ @@ -24,16 +29,17 @@ def _prep_function(*args, **kwargs): else: print('Deprecated (??): xorg profile has no _prep_function() anymore') + # Ensures that this code only gets executed if executed # through importlib.util.spec_from_file_location("gnome", "/somewhere/gnome.py") # or through conventional import gnome if __name__ == 'gnome': # Install dependency profiles - installation.install_profile('xorg') + archinstall.storage['installation_session'].install_profile('xorg') # Install the GNOME packages - installation.add_additional_packages(__packages__) + archinstall.storage['installation_session'].add_additional_packages(__packages__) - installation.enable_service('gdm') # Gnome Display Manager - # We could also start it via xinitrc since we do have Xorg, - # but for gnome that's deprecated and wayland is preferred. + archinstall.storage['installation_session'].enable_service('gdm') # Gnome Display Manager +# We could also start it via xinitrc since we do have Xorg, +# but for gnome that's deprecated and wayland is preferred. diff --git a/profiles/i3.py b/profiles/i3.py index 4d400468..39977b28 100644 --- a/profiles/i3.py +++ b/profiles/i3.py @@ -1,12 +1,21 @@ # Common package for i3, lets user select which i3 configuration they want. -import archinstall, os +import archinstall is_top_level_profile = False # New way of defining packages for a profile, which is iterable and can be used out side # of the profile to get a list of "what packages will be installed". -__packages__ = ['i3lock', 'i3status', 'i3blocks', 'xterm', 'lightdm-gtk-greeter', 'lightdm'] +__packages__ = [ + 'i3lock', + 'i3status', + 'i3blocks', + 'xterm', + 'lightdm-gtk-greeter', + 'lightdm', + 'dmenu', +] + def _prep_function(*args, **kwargs): """ @@ -17,8 +26,7 @@ def _prep_function(*args, **kwargs): """ supported_configurations = ['i3-wm', 'i3-gaps'] - desktop = archinstall.generic_select(supported_configurations, 'Select your desired configuration: ', - allow_empty_input=False, sort=True) + desktop = archinstall.generic_select(supported_configurations, 'Select your desired configuration: ', allow_empty_input=False, sort=True) # Temporarily store the selected desktop profile # in a session-safe location, since this module will get reloaded @@ -33,6 +41,7 @@ def _prep_function(*args, **kwargs): else: print('Deprecated (??): xorg profile has no _prep_function() anymore') + if __name__ == 'i3': """ This "profile" is a meta-profile. @@ -46,18 +55,18 @@ if __name__ == 'i3': There are plenty of desktop-turn-key-solutions based on Arch Linux, this is therefore just a helper to get started """ - + # Install common packages for all i3 configurations - installation.add_additional_packages(__packages__[:4]) + archinstall.storage['installation_session'].add_additional_packages(__packages__[:4]) # Install dependency profiles - installation.install_profile('xorg') + archinstall.storage['installation_session'].install_profile('xorg') - # gaps is installed by deafult so we are overriding it here with lightdm - installation.add_additional_packages(__packages__[4:]) + # gaps is installed by default so we are overriding it here with lightdm + archinstall.storage['installation_session'].add_additional_packages(__packages__[4:]) # Auto start lightdm for all users - installation.enable_service('lightdm') + archinstall.storage['installation_session'].enable_service('lightdm') # install the i3 group now - installation.add_additional_packages(installation, archinstall.storage['_i3_configuration'])
\ No newline at end of file + archinstall.storage['installation_session'].add_additional_packages(archinstall.storage['_i3_configuration']) diff --git a/profiles/kde.py b/profiles/kde.py index c8efdcde..c58f4f45 100644 --- a/profiles/kde.py +++ b/profiles/kde.py @@ -1,13 +1,23 @@ # A desktop environment using "KDE". -import archinstall, os +import archinstall is_top_level_profile = False -__packages__ = ["plasma-meta", "konsole", "kate", "dolphin", "sddm", "plasma-wayland-session", "egl-wayland"] +__packages__ = [ + "plasma-meta", + "konsole", + "kate", + "dolphin", + "sddm", + "plasma-wayland-session", + "egl-wayland", +] + # TODO: Remove hard dependency of bash (due to .bash_profile) + def _prep_function(*args, **kwargs): """ Magic function called by the importing installer @@ -24,6 +34,7 @@ def _prep_function(*args, **kwargs): else: print('Deprecated (??): xorg profile has no _prep_function() anymore') + """ def _post_install(*args, **kwargs): if "nvidia" in _gfx_driver_packages: @@ -37,10 +48,10 @@ def _post_install(*args, **kwargs): # or through conventional import kde if __name__ == 'kde': # Install dependency profiles - installation.install_profile('xorg') + archinstall.storage['installation_session'].install_profile('xorg') # Install the KDE packages - installation.add_additional_packages(__packages__) + archinstall.storage['installation_session'].add_additional_packages(__packages__) # Enable autostart of KDE for all users - installation.enable_service('sddm') + archinstall.storage['installation_session'].enable_service('sddm') diff --git a/profiles/lxqt.py b/profiles/lxqt.py index d0727a90..2419b4fa 100644 --- a/profiles/lxqt.py +++ b/profiles/lxqt.py @@ -1,11 +1,23 @@ - # A desktop environment using "LXQt" import archinstall is_top_level_profile = False -__packages__ = ["lxqt", "breeze-icons", "oxygen-icons", "xdg-utils", "ttf-freefont", "leafpad", "slock", "sddm"] +# NOTE: SDDM is the only officially supported greeter for LXQt, so unlike other DEs, lightdm is not used here. +# LXQt works with lightdm, but since this is not supported, we will not default to this. +# https://github.com/lxqt/lxqt/issues/795 +__packages__ = [ + "lxqt", + "breeze-icons", + "oxygen-icons", + "xdg-utils", + "ttf-freefont", + "leafpad", + "slock", + "sddm", +] + def _prep_function(*args, **kwargs): """ @@ -23,14 +35,16 @@ def _prep_function(*args, **kwargs): else: print('Deprecated (??): xorg profile has no _prep_function() anymore') + # Ensures that this code only gets executed if executed # through importlib.util.spec_from_file_location("lxqt", "/somewhere/lxqt.py") # or through conventional import lxqt if __name__ == 'lxqt': # Install dependency profiles - installation.install_profile('xorg') + archinstall.storage['installation_session'].install_profile('xorg') # Install the LXQt packages - installation.add_additional_packages(__packages__) + archinstall.storage['installation_session'].add_additional_packages(__packages__) - installation.enable_service('sddm') # SDDM Display Manager + # Enable autostart of LXQt for all users + archinstall.storage['installation_session'].enable_service('sddm') diff --git a/profiles/mate.py b/profiles/mate.py index 2cfe7305..94b91f81 100644 --- a/profiles/mate.py +++ b/profiles/mate.py @@ -4,7 +4,13 @@ import archinstall is_top_level_profile = False -__packages__ = ["mate", "mate-extra", "lightdm", "lightdm-gtk-greeter"] +__packages__ = [ + "mate", + "mate-extra", + "lightdm", + "lightdm-gtk-greeter", +] + def _prep_function(*args, **kwargs): """ @@ -22,14 +28,15 @@ def _prep_function(*args, **kwargs): else: print('Deprecated (??): xorg profile has no _prep_function() anymore') + # Ensures that this code only gets executed if executed # through importlib.util.spec_from_file_location("mate", "/somewhere/mate.py") # or through conventional import mate if __name__ == 'mate': # Install dependency profiles - installation.install_profile('xorg') + archinstall.storage['installation_session'].install_profile('xorg') # Install the MATE packages - installation.add_additional_packages(__packages__) + archinstall.storage['installation_session'].add_additional_packages(__packages__) - installation.enable_service('lightdm') # Light Display Manager + archinstall.storage['installation_session'].enable_service('lightdm') # Light Display Manager diff --git a/profiles/minimal.py b/profiles/minimal.py index 79821a89..13cfd05a 100644 --- a/profiles/minimal.py +++ b/profiles/minimal.py @@ -1,9 +1,8 @@ # Used to do a minimal install -import archinstall, os - is_top_level_profile = True + def _prep_function(*args, **kwargs): """ Magic function called by the importing installer @@ -11,7 +10,8 @@ def _prep_function(*args, **kwargs): we don't need to do anything special here, but it needs to exist and return True. """ - return True # Do nothing and just return True + return True # Do nothing and just return True + if __name__ == 'minimal': """ diff --git a/profiles/server.py b/profiles/server.py new file mode 100644 index 00000000..704c8efe --- /dev/null +++ b/profiles/server.py @@ -0,0 +1,44 @@ +# Used to select various server application profiles on top of a minimal installation. + +import logging + +import archinstall + +is_top_level_profile = True + +available_servers = [ + "cockpit", + "docker", + "httpd", + "lighttpd", + "mariadb", + "nginx", + "postgresql", + "sshd", + "tomcat", +] + + +def _prep_function(*args, **kwargs): + """ + Magic function called by the importing installer + before continuing any further. + """ + selected_servers = archinstall.generic_multi_select(available_servers, "Choose which servers to install and enable (leave blank for a minimal installation): ") + archinstall.storage['_selected_servers'] = selected_servers + + return True + + +if __name__ == 'server': + """ + This "profile" is a meta-profile. + """ + archinstall.log('Now installing the selected servers.', level=logging.INFO) + archinstall.log(archinstall.storage['_selected_servers'], level=logging.DEBUG) + for server in archinstall.storage['_selected_servers']: + archinstall.log(f'Installing {server} ...', level=logging.INFO) + app = archinstall.Application(archinstall.storage['installation_session'], server) + app.install() + + archinstall.log('If your selections included multiple servers with the same port, you may have to reconfigure them.', fg="yellow", level=logging.INFO) diff --git a/profiles/sway.py b/profiles/sway.py index db94ae2c..9afc047d 100644 --- a/profiles/sway.py +++ b/profiles/sway.py @@ -4,7 +4,19 @@ import archinstall is_top_level_profile = False -__packages__ = ["sway", "swaylock", "swayidle", "waybar", "dmenu", "light", "grim", "slurp", "pavucontrol", "alacritty"] +__packages__ = [ + "sway", + "swaylock", + "swayidle", + "waybar", + "dmenu", + "light", + "grim", + "slurp", + "pavucontrol", + "alacritty", +] + def _prep_function(*args, **kwargs): """ @@ -13,18 +25,22 @@ def _prep_function(*args, **kwargs): other code in this stage. So it's a safe way to ask the user for more input before any other installer steps start. """ - if "nvidia" in _gfx_driver_packages: - choice = input("The proprietary Nvidia driver is not supported by Sway. It is likely that you will run into issues. Continue anyways? [y/N] ") - if choice.lower() in ("n", ""): - raise archinstall.lib.exceptions.HardwareIncompatibilityError("Sway does not support the proprietary nvidia drivers.") - - __builtins__['_gfx_driver_packages'] = archinstall.select_driver() + __builtins__["_gfx_driver_packages"] = archinstall.select_driver() return True + # Ensures that this code only gets executed if executed # through importlib.util.spec_from_file_location("sway", "/somewhere/sway.py") # or through conventional import sway -if __name__ == 'sway': +if __name__ == "sway": + if "nvidia" in _gfx_driver_packages: + choice = input("The proprietary Nvidia driver is not supported by Sway. It is likely that you will run into issues. Continue anyways? [y/N] ") + if choice.lower() in ("n", ""): + raise archinstall.lib.exceptions.HardwareIncompatibilityError("Sway does not support the proprietary nvidia drivers.") + # Install the Sway packages - installation.add_additional_packages(__packages__) + archinstall.storage['installation_session'].add_additional_packages(__packages__) + + # Install the graphics driver packages + archinstall.storage['installation_session'].add_additional_packages(_gfx_driver_packages) diff --git a/profiles/xfce4.py b/profiles/xfce4.py index 8102919b..8dbb04ec 100644 --- a/profiles/xfce4.py +++ b/profiles/xfce4.py @@ -1,11 +1,17 @@ - # A desktop environment using "Xfce4" import archinstall is_top_level_profile = False -__packages__ = ["xfce4", "xfce4-goodies", "lightdm", "lightdm-gtk-greeter"] +__packages__ = [ + "xfce4", + "xfce4-goodies", + "pavucontrol", + "lightdm", + "lightdm-gtk-greeter", +] + def _prep_function(*args, **kwargs): """ @@ -23,14 +29,15 @@ def _prep_function(*args, **kwargs): else: print('Deprecated (??): xorg profile has no _prep_function() anymore') + # Ensures that this code only gets executed if executed # through importlib.util.spec_from_file_location("xfce4", "/somewhere/xfce4.py") # or through conventional import xfce4 if __name__ == 'xfce4': # Install dependency profiles - installation.install_profile('xorg') + archinstall.storage['installation_session'].install_profile('xorg') # Install the XFCE4 packages - installation.add_additional_packages(__packages__) + archinstall.storage['installation_session'].add_additional_packages(__packages__) - installation.enable_service('lightdm') # Light Display Manager + archinstall.storage['installation_session'].enable_service('lightdm') # Light Display Manager diff --git a/profiles/xorg.py b/profiles/xorg.py index 7546a01b..b8fb2cbb 100644 --- a/profiles/xorg.py +++ b/profiles/xorg.py @@ -1,11 +1,18 @@ # A system with "xorg" installed -import os import archinstall is_top_level_profile = True -__packages__ = ['dkms', 'xorg-server', 'xorg-xinit', 'nvidia-dkms', 'xorg-server', *archinstall.lib.hardware.__packages__] +__packages__ = [ + 'dkms', + 'xorg-server', + 'xorg-xinit', + 'nvidia-dkms', + 'xorg-server', + *archinstall.lib.hardware.__packages__, +] + def _prep_function(*args, **kwargs): """ @@ -22,28 +29,19 @@ def _prep_function(*args, **kwargs): return True + # Ensures that this code only gets executed if executed # through importlib.util.spec_from_file_location("xorg", "/somewhere/xorg.py") # or through conventional import xorg if __name__ == 'xorg': try: if "nvidia" in _gfx_driver_packages: - if "linux-zen" in installation.base_packages or "linux-lts" in installation.base_packages: - installation.add_additional_packages("dkms")#I've had kernel regen fail if it wasn't installed before nvidia-dkms - installation.add_additional_packages("xorg-server xorg-xinit nvidia-dkms") + if "linux-zen" in archinstall.storage['installation_session'].base_packages or "linux-lts" in archinstall.storage['installation_session'].base_packages: + archinstall.storage['installation_session'].add_additional_packages("dkms") # I've had kernel regen fail if it wasn't installed before nvidia-dkms + archinstall.storage['installation_session'].add_additional_packages("xorg-server xorg-xinit nvidia-dkms") else: - installation.add_additional_packages(f"xorg-server xorg-xinit {' '.join(_gfx_driver_packages)}") + archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit {' '.join(_gfx_driver_packages)}") else: - installation.add_additional_packages(f"xorg-server xorg-xinit {' '.join(_gfx_driver_packages)}") + archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit {' '.join(_gfx_driver_packages)}") except: - installation.add_additional_packages(f"xorg-server xorg-xinit") # Prep didn't run, so there's no driver to install - - # with open(f'{installation.mountpoint}/etc/X11/xinit/xinitrc', 'a') as X11: - # X11.write('setxkbmap se\n') - - # with open(f'{installation.mountpoint}/etc/vconsole.conf', 'a') as vconsole: - # vconsole.write('KEYMAP={keyboard_layout}\n'.format(**arguments)) - # vconsole.write('FONT=lat9w-16\n') - - # awesome = archinstall.Application(installation, 'awesome') - # awesome.install()
\ No newline at end of file + archinstall.storage['installation_session'].add_additional_packages("xorg-server xorg-xinit") # Prep didn't run, so there's no driver to install |