Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/profiles
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-05-15 17:49:58 +0000
committerGitHub <noreply@github.com>2021-05-15 17:49:58 +0000
commita75dd6ea3a4f961ddfeaff6b4378bd4aac5c3b39 (patch)
tree7db58a8b4e1c640dc16d0060704f3b304a4e325d /profiles
parent5254ac62200bb279c855d06bea1006b323bfae87 (diff)
parent5067aaa260d218f7d1d60ada2fe8413e90970060 (diff)
Merge pull request #447 from dylanmtaylor/formatting
Very selectively fix some PEP 8 issues and other manual formatting changes
Diffstat (limited to 'profiles')
-rw-r--r--profiles/52-54-00-12-34-56.py11
-rw-r--r--profiles/applications/postgresql.py2
-rw-r--r--profiles/awesome.py9
-rw-r--r--profiles/budgie.py6
-rw-r--r--profiles/cinnamon.py15
-rw-r--r--profiles/deepin.py3
-rw-r--r--profiles/desktop.py44
-rw-r--r--profiles/enlightenment.py3
-rw-r--r--profiles/gnome.py4
-rw-r--r--profiles/i3.py11
-rw-r--r--profiles/kde.py5
-rw-r--r--profiles/lxqt.py5
-rw-r--r--profiles/mate.py4
-rw-r--r--profiles/minimal.py6
-rw-r--r--profiles/server.py8
-rw-r--r--profiles/sway.py4
-rw-r--r--profiles/xfce4.py5
-rw-r--r--profiles/xorg.py5
18 files changed, 104 insertions, 46 deletions
diff --git a/profiles/52-54-00-12-34-56.py b/profiles/52-54-00-12-34-56.py
index 28cd14f6..e1361073 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(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)
@@ -27,7 +28,7 @@ with archinstall.Filesystem(harddrive) as fs:
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/applications/postgresql.py b/profiles/applications/postgresql.py
index 3f8c6950..29546d78 100644
--- a/profiles/applications/postgresql.py
+++ b/profiles/applications/postgresql.py
@@ -8,4 +8,4 @@ archinstall.storage['installation_session'].add_additional_packages(__packages__
archinstall.storage['installation_session'].arch_chroot("initdb -D /var/lib/postgres/data", runas='postgres')
-archinstall.storage['installation_session'].enable_service('postgresql') \ No newline at end of file
+archinstall.storage['installation_session'].enable_service('postgresql')
diff --git a/profiles/awesome.py b/profiles/awesome.py
index ee812eb3..aa4702a6 100644
--- a/profiles/awesome.py
+++ b/profiles/awesome.py
@@ -8,6 +8,7 @@ is_top_level_profile = False
# of the profile to get a list of "what packages will be installed".
__packages__ = ['nemo', 'gpicview', 'main', 'alacritty']
+
def _prep_function(*args, **kwargs):
"""
Magic function called by the importing installer
@@ -39,14 +40,14 @@ if __name__ == 'awesome':
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"{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
+ # 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 dbbd3a9d..abaf87b0 100644
--- a/profiles/budgie.py
+++ b/profiles/budgie.py
@@ -4,9 +4,10 @@ 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
+# "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"]
+
def _prep_function(*args, **kwargs):
"""
Magic function called by the importing installer
@@ -23,6 +24,7 @@ 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
@@ -33,4 +35,4 @@ if __name__ == 'budgie':
# Install the Budgie packages
archinstall.storage['installation_session'].add_additional_packages(__packages__)
- archinstall.storage['installation_session'].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 89798671..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,6 +32,7 @@ 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
@@ -32,4 +43,4 @@ if __name__ == 'cinnamon':
# Install the Cinnamon packages
archinstall.storage['installation_session'].add_additional_packages(__packages__)
- archinstall.storage['installation_session'].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 757597f3..ebe730e2 100644
--- a/profiles/deepin.py
+++ b/profiles/deepin.py
@@ -1,11 +1,12 @@
# A desktop environment using "Deepin".
-import archinstall, os
+import archinstall
is_top_level_profile = False
__packages__ = ["deepin", "deepin-terminal", "deepin-editor", "lightdm", "lightdm-gtk-greeter"]
+
def _prep_function(*args, **kwargs):
"""
Magic function called by the importing installer
diff --git a/profiles/desktop.py b/profiles/desktop.py
index 9e1d8b4c..67514a97 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,11 +28,25 @@ 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', 'deepin', 'enlightenment']
+ 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
+ )
- 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.
@@ -34,6 +60,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.
@@ -47,9 +74,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
archinstall.storage['installation_session'].add_additional_packages(__packages__)
-
- archinstall.storage['installation_session'].install_profile(archinstall.storage['_desktop_profile'])
+ archinstall.storage['installation_session'].install_profile(archinstall.storage['_desktop_profile'])
diff --git a/profiles/enlightenment.py b/profiles/enlightenment.py
index 6ff334de..cfb97836 100644
--- a/profiles/enlightenment.py
+++ b/profiles/enlightenment.py
@@ -1,11 +1,12 @@
# A desktop environment using "Enlightenment".
-import archinstall, os
+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
diff --git a/profiles/gnome.py b/profiles/gnome.py
index e6cc75c0..09fac1bb 100644
--- a/profiles/gnome.py
+++ b/profiles/gnome.py
@@ -7,6 +7,7 @@ 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"]
+
def _prep_function(*args, **kwargs):
"""
Magic function called by the importing installer
@@ -24,6 +25,7 @@ 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
@@ -34,6 +36,6 @@ if __name__ == 'gnome':
# Install the GNOME packages
archinstall.storage['installation_session'].add_additional_packages(__packages__)
- archinstall.storage['installation_session'].enable_service('gdm') # Gnome Display Manager
+ 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 e99bc549..418749c0 100644
--- a/profiles/i3.py
+++ b/profiles/i3.py
@@ -1,6 +1,6 @@
# Common package for i3, lets user select which i3 configuration they want.
-import archinstall, os
+import archinstall
is_top_level_profile = False
@@ -8,6 +8,7 @@ is_top_level_profile = False
# of the profile to get a list of "what packages will be installed".
__packages__ = ['i3lock', 'i3status', 'i3blocks', 'xterm', 'lightdm-gtk-greeter', 'lightdm', 'dmenu']
+
def _prep_function(*args, **kwargs):
"""
Magic function called by the importing installer
@@ -17,8 +18,9 @@ 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 +35,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,7 +49,7 @@ 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
archinstall.storage['installation_session'].add_additional_packages(__packages__[:4])
diff --git a/profiles/kde.py b/profiles/kde.py
index aac5ade4..451704b9 100644
--- a/profiles/kde.py
+++ b/profiles/kde.py
@@ -1,13 +1,15 @@
# 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"]
+
# TODO: Remove hard dependency of bash (due to .bash_profile)
+
def _prep_function(*args, **kwargs):
"""
Magic function called by the importing installer
@@ -24,6 +26,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:
diff --git a/profiles/lxqt.py b/profiles/lxqt.py
index 025d033d..af6337e6 100644
--- a/profiles/lxqt.py
+++ b/profiles/lxqt.py
@@ -1,4 +1,3 @@
-
# A desktop environment using "LXQt"
import archinstall
@@ -7,6 +6,7 @@ is_top_level_profile = False
__packages__ = ["lxqt", "breeze-icons", "oxygen-icons", "xdg-utils", "ttf-freefont", "leafpad", "slock", "sddm"]
+
def _prep_function(*args, **kwargs):
"""
Magic function called by the importing installer
@@ -23,6 +23,7 @@ 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
@@ -33,4 +34,4 @@ if __name__ == 'lxqt':
# Install the LXQt packages
archinstall.storage['installation_session'].add_additional_packages(__packages__)
- archinstall.storage['installation_session'].enable_service('sddm') # SDDM Display Manager
+ archinstall.storage['installation_session'].enable_service('sddm') # SDDM Display Manager
diff --git a/profiles/mate.py b/profiles/mate.py
index e2421ed8..351f2250 100644
--- a/profiles/mate.py
+++ b/profiles/mate.py
@@ -6,6 +6,7 @@ is_top_level_profile = False
__packages__ = ["mate", "mate-extra", "lightdm", "lightdm-gtk-greeter"]
+
def _prep_function(*args, **kwargs):
"""
Magic function called by the importing installer
@@ -22,6 +23,7 @@ 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
@@ -32,4 +34,4 @@ if __name__ == 'mate':
# Install the MATE packages
archinstall.storage['installation_session'].add_additional_packages(__packages__)
- archinstall.storage['installation_session'].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
index d0346ace..afc37776 100644
--- a/profiles/server.py
+++ b/profiles/server.py
@@ -1,11 +1,14 @@
# Used to select various server application profiles on top of a minimal installation.
-import archinstall, os, logging
+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
@@ -13,9 +16,10 @@ def _prep_function(*args, **kwargs):
"""
selected_servers = archinstall.generic_multi_select(available_servers, f"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.
diff --git a/profiles/sway.py b/profiles/sway.py
index e90e5e8d..686fe868 100644
--- a/profiles/sway.py
+++ b/profiles/sway.py
@@ -39,9 +39,7 @@ if __name__ == "sway":
"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."
- )
+ raise archinstall.lib.exceptions.HardwareIncompatibilityError("Sway does not support the proprietary nvidia drivers.")
# Install the Sway packages
archinstall.storage['installation_session'].add_additional_packages(__packages__)
diff --git a/profiles/xfce4.py b/profiles/xfce4.py
index 43da23ac..ad00c461 100644
--- a/profiles/xfce4.py
+++ b/profiles/xfce4.py
@@ -1,4 +1,3 @@
-
# A desktop environment using "Xfce4"
import archinstall
@@ -7,6 +6,7 @@ is_top_level_profile = False
__packages__ = ["xfce4", "xfce4-goodies", "lightdm", "lightdm-gtk-greeter"]
+
def _prep_function(*args, **kwargs):
"""
Magic function called by the importing installer
@@ -23,6 +23,7 @@ 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
@@ -33,4 +34,4 @@ if __name__ == 'xfce4':
# Install the XFCE4 packages
archinstall.storage['installation_session'].add_additional_packages(__packages__)
- archinstall.storage['installation_session'].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 19ca92d7..3351e4e5 100644
--- a/profiles/xorg.py
+++ b/profiles/xorg.py
@@ -1,12 +1,12 @@
# 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__]
+
def _prep_function(*args, **kwargs):
"""
Magic function called by the importing installer
@@ -22,6 +22,7 @@ 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
@@ -36,4 +37,4 @@ if __name__ == 'xorg':
else:
archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit {' '.join(_gfx_driver_packages)}")
except:
- archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit") # Prep didn't run, so there's no driver to 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 \ No newline at end of file