WLR errors when trying to start `sway`

Hey there. When I start sway from the tty via the command sway, I get a couple of errors:

EGL_EXT_platform_base not supported
Failed to create EGL context
Could not initialize EGL
Could not initialize renderer
Failed to create renderer

Here is my configuration:

security.polkit.enable = true;

  home-manager.users.mikkel = { pkgs, ... }: {
    wayland.windowManager.sway = {
      enable = true;
      config = {
        modifier = "Mod1";
        terminal = "alacritty";
        output = {
          DP-1 = {
            res = "1920x1080@144.000Hz";
          };
          DP-2 = {
            res = "1920x1080@144.000Hz";
          };
        };
      };
    };

Does anyone have an idea why this is and how to quickly fix it? When I enable sway on the system level + on home-manager, everything works. However, I would like to ONLY use home-manager.

(I do not have any NVIDIA hardware components, I have an AMD GPU and CPU).

Can you run strace sway and give us the output. It is failing to get an opengl context, but hard to say why without more info

I am trying to give you the long output, but for some reason sudo strace sway | nc termbin.com 9999 just does not give me the link for the sharing.

@danielbarter here the output: sudo strace sway```execve("/etc/profiles/per-user/mikkel/bin/sway", ["sway - Pastebin.com

Alright, since I only enabled sway via home-manager and also do not have xserver enabled, I needed to appropriately enable opengl to make the wayland compositor work properly.

So the fix is very simple, just add this line to your system configuration:

hardware.opengl.enable = true