Installing sway on debian

Hi,

It has been a few weeks since I have started using nix on my debian machine through home-manager.

I am using sway, so I was considering to reinstall it with nix (currently it is installed via apt), but it didn’t work out. Actually, I have little clues about what might be the cause of this problem.

So here I am, a little confused, searching for help from you guys.

I have tried to install sway using ubuntu and ubuntu-server with the same nix setup (home-manager) and it worked out of the box.

Do you have some ideas of what might cause this issue ?

Maybe, I am lacking some packages,…

Thanks!

PS:

Here are the logs

for a debian vm:

00:00:00.000 [INFO] [sway/main.c:338] Sway version 1.9
00:00:00.000 [INFO] [sway/main.c:339] wlroots version 0.17.2
00:00:00.001 [INFO] [sway/main.c:120] Linux debian 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux
00:00:00.002 [INFO] [sway/main.c:136] Contents of /etc/os-release:
00:00:00.002 [INFO] [sway/main.c:120] PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
00:00:00.002 [INFO] [sway/main.c:120] NAME="Debian GNU/Linux"
00:00:00.002 [INFO] [sway/main.c:120] VERSION_ID="12"
00:00:00.002 [INFO] [sway/main.c:120] VERSION="12 (bookworm)"
00:00:00.002 [INFO] [sway/main.c:120] VERSION_CODENAME=bookworm
00:00:00.002 [INFO] [sway/main.c:120] ID=debian
00:00:00.002 [INFO] [sway/main.c:120] HOME_URL="https://www.debian.org/"
00:00:00.002 [INFO] [sway/main.c:120] SUPPORT_URL="https://www.debian.org/support"
00:00:00.002 [INFO] [sway/main.c:120] BUG_REPORT_URL="https://bugs.debian.org/"
00:00:00.002 [INFO] [sway/main.c:136] Contents of /etc/debian_version:
00:00:00.002 [INFO] [sway/main.c:120] 12.5
00:00:00.002 [INFO] [sway/main.c:108] LD_LIBRARY_PATH=
00:00:00.002 [INFO] [sway/main.c:108] LD_PRELOAD=
00:00:00.002 [INFO] [sway/main.c:108] PATH=/home/allan/.nix-profile/bin:/home/allan/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
00:00:00.002 [INFO] [sway/main.c:108] SWAYSOCK=
00:00:00.002 [INFO] [sway/main.c:376] Starting sway version 1.9
00:00:00.002 [DEBUG] [sway/server.c:129] Initializing Wayland server
00:00:00.002 [INFO] [wlr] [libseat] [libseat/backend/seatd.c:64] Could not connect to socket /run/seatd.sock: No such file or directory
00:00:00.002 [INFO] [wlr] [libseat] [libseat/libseat.c:76] Backend 'seatd' failed to open seat, skipping
00:00:00.011 [INFO] [wlr] [libseat] [libseat/libseat.c:73] Seat opened with backend 'logind'
00:00:00.011 [INFO] [wlr] [backend/session/session.c:109] Successfully loaded libseat session
00:00:00.012 [INFO] [wlr] [backend/backend.c:213] Found 1 GPUs
00:00:00.012 [INFO] [wlr] [backend/drm/backend.c:202] Initializing DRM backend for /dev/dri/card0 (virtio_gpu)
00:00:00.012 [DEBUG] [wlr] [backend/drm/drm.c:110] Using atomic DRM interface
00:00:00.012 [DEBUG] [wlr] [backend/drm/drm.c:123] ADDFB2 modifiers unsupported
00:00:00.012 [INFO] [wlr] [backend/drm/drm.c:255] Found 1 DRM CRTCs
00:00:00.012 [INFO] [wlr] [backend/drm/drm.c:213] Found 2 DRM planes
00:00:00.013 [INFO] [wlr] [render/egl.c:206] Supported EGL client extensions: 
00:00:00.013 [ERROR] [wlr] [render/egl.c:209] EGL_EXT_platform_base not supported
00:00:00.013 [ERROR] [wlr] [render/egl.c:524] Failed to create EGL context
00:00:00.013 [ERROR] [wlr] [render/gles2/renderer.c:804] Could not initialize EGL
00:00:00.013 [DEBUG] [wlr] [render/wlr_renderer.c:343] Failed to create a GLES2 renderer. Skipping!
00:00:00.013 [ERROR] [wlr] [render/wlr_renderer.c:423] Could not initialize renderer
00:00:00.013 [ERROR] [sway/server.c:143] Failed to create renderer

for a ubuntu vm:

00:00:00.000 [INFO] [sway/main.c:338] Sway version 1.9
00:00:00.000 [INFO] [sway/main.c:339] wlroots version 0.17.2
00:00:00.001 [INFO] [sway/main.c:120] Linux lan 5.15.0-101-generic #111-Ubuntu SMP Tue Mar 5 20:16:58 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
00:00:00.001 [INFO] [sway/main.c:136] Contents of /etc/lsb-release:
00:00:00.001 [INFO] [sway/main.c:120] DISTRIB_ID=Ubuntu
00:00:00.001 [INFO] [sway/main.c:120] DISTRIB_RELEASE=22.04
00:00:00.001 [INFO] [sway/main.c:120] DISTRIB_CODENAME=jammy
00:00:00.001 [INFO] [sway/main.c:120] DISTRIB_DESCRIPTION="Ubuntu 22.04.4 LTS"
00:00:00.001 [INFO] [sway/main.c:136] Contents of /etc/os-release:
00:00:00.001 [INFO] [sway/main.c:120] PRETTY_NAME="Ubuntu 22.04.4 LTS"
00:00:00.001 [INFO] [sway/main.c:120] NAME="Ubuntu"
00:00:00.001 [INFO] [sway/main.c:120] VERSION_ID="22.04"
00:00:00.001 [INFO] [sway/main.c:120] VERSION="22.04.4 LTS (Jammy Jellyfish)"
00:00:00.001 [INFO] [sway/main.c:120] VERSION_CODENAME=jammy
00:00:00.001 [INFO] [sway/main.c:120] ID=ubuntu
00:00:00.001 [INFO] [sway/main.c:120] ID_LIKE=debian
00:00:00.001 [INFO] [sway/main.c:120] HOME_URL="https://www.ubuntu.com/"
00:00:00.001 [INFO] [sway/main.c:120] SUPPORT_URL="https://help.ubuntu.com/"
00:00:00.001 [INFO] [sway/main.c:120] BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
00:00:00.001 [INFO] [sway/main.c:120] PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
00:00:00.001 [INFO] [sway/main.c:120] UBUNTU_CODENAME=jammy
00:00:00.001 [INFO] [sway/main.c:136] Contents of /etc/debian_version:
00:00:00.001 [INFO] [sway/main.c:120] bookworm/sid
00:00:00.001 [INFO] [sway/main.c:108] LD_LIBRARY_PATH=
00:00:00.001 [INFO] [sway/main.c:108] LD_PRELOAD=
00:00:00.001 [INFO] [sway/main.c:108] PATH=/home/allan/.nix-profile/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
00:00:00.001 [INFO] [sway/main.c:108] SWAYSOCK=
00:00:00.001 [INFO] [sway/main.c:376] Starting sway version 1.9
00:00:00.001 [DEBUG] [sway/server.c:129] Initializing Wayland server
00:00:00.001 [INFO] [wlr] [libseat] [libseat/backend/seatd.c:64] Could not connect to socket /run/seatd.sock: No such file or directory
00:00:00.001 [INFO] [wlr] [libseat] [libseat/libseat.c:76] Backend 'seatd' failed to open seat, skipping
00:00:00.006 [INFO] [wlr] [libseat] [libseat/libseat.c:73] Seat opened with backend 'logind'
00:00:00.006 [INFO] [wlr] [backend/session/session.c:109] Successfully loaded libseat session
00:00:00.009 [INFO] [wlr] [backend/backend.c:213] Found 1 GPUs
00:00:00.009 [INFO] [wlr] [backend/drm/backend.c:202] Initializing DRM backend for /dev/dri/card0 (qxl)
00:00:00.009 [DEBUG] [wlr] [backend/drm/drm.c:110] Using atomic DRM interface
00:00:00.009 [DEBUG] [wlr] [backend/drm/drm.c:123] ADDFB2 modifiers unsupported
00:00:00.009 [INFO] [wlr] [backend/drm/drm.c:255] Found 4 DRM CRTCs
00:00:00.009 [INFO] [wlr] [backend/drm/drm.c:213] Found 8 DRM planes
00:00:00.010 [INFO] [wlr] [render/egl.c:206] Supported EGL client extensions: 
00:00:00.010 [ERROR] [wlr] [render/egl.c:209] EGL_EXT_platform_base not supported
00:00:00.010 [ERROR] [wlr] [render/egl.c:524] Failed to create EGL context
00:00:00.010 [ERROR] [wlr] [render/gles2/renderer.c:804] Could not initialize EGL
00:00:00.010 [DEBUG] [wlr] [render/wlr_renderer.c:343] Failed to create a GLES2 renderer. Skipping!
00:00:00.010 [INFO] [wlr] [render/pixman/renderer.c:537] Creating pixman renderer
00:00:00.010 [DEBUG] [wlr] [render/allocator/allocator.c:134] Trying to create drm dumb allocator
00:00:00.010 [DEBUG] [wlr] [render/allocator/allocator.c:46] drmModeCreateLease failed, falling back to plain open
00:00:00.010 [DEBUG] [wlr] [render/allocator/drm_dumb.c:229] Created DRM dumb allocator
00:00:00.010 [DEBUG] [wlr] [types/wlr_drm_lease_v1.c:635] Creating wlr_drm_lease_device_v1 for /dev/dri/card0
00:00:00.010 [INFO] [wlr] [backend/headless/backend.c:67] Creating headless backend

Since the host operating system (Debian) takes care of GPU initialization and libraries, it is a bit difficult to get deeper integrated tools like sway/wlroots running.

Might be worth a shot trying nixGL wrapper for launching sway.

Since sway 1.9 (and a bit earlier) there is deeper integration with seat managers, unfortunately that is not well documented by sway and I couldn’t find something helpful there myself, I think you should be able to launch sway with those warnings though.

Overall I’d encourage you to switch to NixOS fully or try to use it just for CLI tools, but keep using Debian upstream packages for sway, Firefox, …

1 Like

Hi, thanks for your answer. Well, I will definitely consider to switch to nixos.

1 Like