We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
_gfx_driver_packages not defined when choosing sway option (current master build)
![VirtualBox_Arch_30_04_2021_23_01_50](https://user-images.githubusercontent.com/277927/116769175-37f20400-aa08-11eb-92cb-6c50348296d1.png)

_gfx_driver_packages not defined when choosing sway option (current master build)
![VirtualBox_Arch_30_04_2021_23_01_50](https://user-images.githubusercontent.com/277927/116769175-37f20400-aa08-11eb-92cb-6c50348296d1.png)

_gfx_driver_packages not defined when choosing sway option (current master build)
![VirtualBox_Arch_30_04_2021_23_01_50](https://user-images.githubusercontent.com/277927/116769175-37f20400-aa08-11eb-92cb-6c50348296d1.png)


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `profiles/sway.py`
Content:
```
1 # A desktop environment using "Sway"
2 
3 import archinstall
4 
5 is_top_level_profile = False
6 
7 __packages__ = ["sway", "swaylock", "swayidle", "waybar", "dmenu", "light", "grim", "slurp", "pavucontrol", "alacritty"]
8 
9 def _prep_function(*args, **kwargs):
10 	"""
11 	Magic function called by the importing installer
12 	before continuing any further. It also avoids executing any
13 	other code in this stage. So it's a safe way to ask the user
14 	for more input before any other installer steps start.
15 	"""
16 	if "nvidia" in _gfx_driver_packages:
17 		choice = input("The proprietary Nvidia driver is not supported by Sway. It is likely that you will run into issues. Continue anyways? [y/N] ")
18 		if choice.lower() in ("n", ""):
19 			raise archinstall.lib.exceptions.HardwareIncompatibilityError("Sway does not support the proprietary nvidia drivers.")
20 
21 	__builtins__['_gfx_driver_packages'] = archinstall.select_driver()
22 
23 	return True
24 
25 # Ensures that this code only gets executed if executed
26 # through importlib.util.spec_from_file_location("sway", "/somewhere/sway.py")
27 # or through conventional import sway
28 if __name__ == 'sway':
29 	# Install the Sway packages
30 	installation.add_additional_packages(__packages__)
31
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/profiles/sway.py b/profiles/sway.py
--- a/profiles/sway.py
+++ b/profiles/sway.py
@@ -4,7 +4,19 @@
 
 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,26 @@
 	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__)
+
+	# Install the graphics driver packages
+	installation.add_additional_packages(_gfx_driver_packages)

{"golden_diff": "diff --git a/profiles/sway.py b/profiles/sway.py\n--- a/profiles/sway.py\n+++ b/profiles/sway.py\n@@ -4,7 +4,19 @@\n \n is_top_level_profile = False\n \n-__packages__ = [\"sway\", \"swaylock\", \"swayidle\", \"waybar\", \"dmenu\", \"light\", \"grim\", \"slurp\", \"pavucontrol\", \"alacritty\"]\n+__packages__ = [\n+\t\"sway\",\n+\t\"swaylock\",\n+\t\"swayidle\",\n+\t\"waybar\",\n+\t\"dmenu\",\n+\t\"light\",\n+\t\"grim\",\n+\t\"slurp\",\n+\t\"pavucontrol\",\n+\t\"alacritty\",\n+]\n+\n \n def _prep_function(*args, **kwargs):\n \t\"\"\"\n@@ -13,18 +25,26 @@\n \tother code in this stage. So it's a safe way to ask the user\n \tfor more input before any other installer steps start.\n \t\"\"\"\n-\tif \"nvidia\" in _gfx_driver_packages:\n-\t\tchoice = input(\"The proprietary Nvidia driver is not supported by Sway. It is likely that you will run into issues. Continue anyways? [y/N] \")\n-\t\tif choice.lower() in (\"n\", \"\"):\n-\t\t\traise archinstall.lib.exceptions.HardwareIncompatibilityError(\"Sway does not support the proprietary nvidia drivers.\")\n-\n-\t__builtins__['_gfx_driver_packages'] = archinstall.select_driver()\n+\t__builtins__[\"_gfx_driver_packages\"] = archinstall.select_driver()\n \n \treturn True\n \n+\n # Ensures that this code only gets executed if executed\n # through importlib.util.spec_from_file_location(\"sway\", \"/somewhere/sway.py\")\n # or through conventional import sway\n-if __name__ == 'sway':\n+if __name__ == \"sway\":\n+\tif \"nvidia\" in _gfx_driver_packages:\n+\t\tchoice = input(\n+\t\t\t\"The proprietary Nvidia driver is not supported by Sway. It is likely that you will run into issues. Continue anyways? [y/N] \"\n+\t\t)\n+\t\tif choice.lower() in (\"n\", \"\"):\n+\t\t\traise archinstall.lib.exceptions.HardwareIncompatibilityError(\n+\t\t\t\t\"Sway does not support the proprietary nvidia drivers.\"\n+\t\t\t)\n+\n \t# Install the Sway packages\n \tinstallation.add_additional_packages(__packages__)\n+\n+\t# Install the graphics driver packages\n+\tinstallation.add_additional_packages(_gfx_driver_packages)\n", "issue": "_gfx_driver_packages not defined when choosing sway option (current master build)\n![VirtualBox_Arch_30_04_2021_23_01_50](https://user-images.githubusercontent.com/277927/116769175-37f20400-aa08-11eb-92cb-6c50348296d1.png)\r\n\n_gfx_driver_packages not defined when choosing sway option (current master build)\n![VirtualBox_Arch_30_04_2021_23_01_50](https://user-images.githubusercontent.com/277927/116769175-37f20400-aa08-11eb-92cb-6c50348296d1.png)\r\n\n_gfx_driver_packages not defined when choosing sway option (current master build)\n![VirtualBox_Arch_30_04_2021_23_01_50](https://user-images.githubusercontent.com/277927/116769175-37f20400-aa08-11eb-92cb-6c50348296d1.png)\r\n\n", "before_files": [{"content": "# A desktop environment using \"Sway\"\n\nimport archinstall\n\nis_top_level_profile = False\n\n__packages__ = [\"sway\", \"swaylock\", \"swayidle\", \"waybar\", \"dmenu\", \"light\", \"grim\", \"slurp\", \"pavucontrol\", \"alacritty\"]\n\ndef _prep_function(*args, **kwargs):\n\t\"\"\"\n\tMagic function called by the importing installer\n\tbefore continuing any further. It also avoids executing any\n\tother code in this stage. So it's a safe way to ask the user\n\tfor more input before any other installer steps start.\n\t\"\"\"\n\tif \"nvidia\" in _gfx_driver_packages:\n\t\tchoice = input(\"The proprietary Nvidia driver is not supported by Sway. It is likely that you will run into issues. Continue anyways? [y/N] \")\n\t\tif choice.lower() in (\"n\", \"\"):\n\t\t\traise archinstall.lib.exceptions.HardwareIncompatibilityError(\"Sway does not support the proprietary nvidia drivers.\")\n\n\t__builtins__['_gfx_driver_packages'] = archinstall.select_driver()\n\n\treturn True\n\n# Ensures that this code only gets executed if executed\n# through importlib.util.spec_from_file_location(\"sway\", \"/somewhere/sway.py\")\n# or through conventional import sway\nif __name__ == 'sway':\n\t# Install the Sway packages\n\tinstallation.add_additional_packages(__packages__)\n", "path": "profiles/sway.py"}], "after_files": [{"content": "# A desktop environment using \"Sway\"\n\nimport archinstall\n\nis_top_level_profile = False\n\n__packages__ = [\n\t\"sway\",\n\t\"swaylock\",\n\t\"swayidle\",\n\t\"waybar\",\n\t\"dmenu\",\n\t\"light\",\n\t\"grim\",\n\t\"slurp\",\n\t\"pavucontrol\",\n\t\"alacritty\",\n]\n\n\ndef _prep_function(*args, **kwargs):\n\t\"\"\"\n\tMagic function called by the importing installer\n\tbefore continuing any further. It also avoids executing any\n\tother code in this stage. So it's a safe way to ask the user\n\tfor more input before any other installer steps start.\n\t\"\"\"\n\t__builtins__[\"_gfx_driver_packages\"] = archinstall.select_driver()\n\n\treturn True\n\n\n# Ensures that this code only gets executed if executed\n# through importlib.util.spec_from_file_location(\"sway\", \"/somewhere/sway.py\")\n# or through conventional import sway\nif __name__ == \"sway\":\n\tif \"nvidia\" in _gfx_driver_packages:\n\t\tchoice = input(\n\t\t\t\"The proprietary Nvidia driver is not supported by Sway. It is likely that you will run into issues. Continue anyways? [y/N] \"\n\t\t)\n\t\tif choice.lower() in (\"n\", \"\"):\n\t\t\traise archinstall.lib.exceptions.HardwareIncompatibilityError(\n\t\t\t\t\"Sway does not support the proprietary nvidia drivers.\"\n\t\t\t)\n\n\t# Install the Sway packages\n\tinstallation.add_additional_packages(__packages__)\n\n\t# Install the graphics driver packages\n\tinstallation.add_additional_packages(_gfx_driver_packages)\n", "path": "profiles/sway.py"}]}