I’m trying to use sway on an x86 NixOS machine and configuring it using Home Manager. I am not using a display manager (just using the sway
command from tty). When I try to launch, it fails with the following debug log:
00:00:00.000 [INFO] [sway/main.c:343] Sway version 1.7
00:00:00.000 [INFO] [sway/main.c:344] wlroots version 0.15.1
00:00:00.010 [INFO] [sway/main.c:120] Linux orpheus 5.15.71 #1-NixOS SMP Wed Sep 28 09:11:58 UTC 2022 x86_64 GNU/Linux
00:00:00.011 [INFO] [sway/main.c:136] Contents of /etc/lsb-release:
00:00:00.011 [INFO] [sway/main.c:120] DISTRIB_CODENAME=raccoon
00:00:00.011 [INFO] [sway/main.c:120] DISTRIB_DESCRIPTION="NixOS 22.11 (Raccoon)"
00:00:00.011 [INFO] [sway/main.c:120] DISTRIB_ID=nixos
00:00:00.011 [INFO] [sway/main.c:120] DISTRIB_RELEASE="22.11"
00:00:00.011 [INFO] [sway/main.c:120] LSB_VERSION="22.11 (Raccoon)"
00:00:00.011 [INFO] [sway/main.c:136] Contents of /etc/os-release:
00:00:00.011 [INFO] [sway/main.c:120] BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues"
00:00:00.011 [INFO] [sway/main.c:120] BUILD_ID="22.11.20221005.37bd398"
00:00:00.011 [INFO] [sway/main.c:120] DOCUMENTATION_URL="https://nixos.org/learn.html"
00:00:00.011 [INFO] [sway/main.c:120] HOME_URL="https://nixos.org/"
00:00:00.011 [INFO] [sway/main.c:120] ID=nixos
00:00:00.011 [INFO] [sway/main.c:120] LOGO="nix-snowflake"
00:00:00.011 [INFO] [sway/main.c:120] NAME=NixOS
00:00:00.011 [INFO] [sway/main.c:120] PRETTY_NAME="NixOS 22.11 (Raccoon)"
00:00:00.011 [INFO] [sway/main.c:120] SUPPORT_URL="https://nixos.org/community.html"
00:00:00.011 [INFO] [sway/main.c:120] VERSION="22.11 (Raccoon)"
00:00:00.011 [INFO] [sway/main.c:120] VERSION_CODENAME=raccoon
00:00:00.011 [INFO] [sway/main.c:120] VERSION_ID="22.11"
00:00:00.011 [INFO] [sway/main.c:108] LD_LIBRARY_PATH=
00:00:00.011 [INFO] [sway/main.c:108] LD_PRELOAD=
00:00:00.011 [INFO] [sway/main.c:108] PATH=/run/wrappers/bin:/home/logan/.nix-profile/bin:/etc/profiles/per-user/logan/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin
00:00:00.011 [INFO] [sway/main.c:108] SWAYSOCK=
00:00:00.012 [DEBUG] [sway/server.c:50] Preparing Wayland server initialization
00:00:00.013 [INFO] [wlr] [libseat] [libseat/backend/seatd.c:64] Could not connect to socket /run/seatd.sock: No such file or directory
00:00:00.013 [INFO] [wlr] [libseat] [libseat/libseat.c:76] Backend 'seatd' failed to open seat, skipping
00:00:00.013 [INFO] [wlr] [libseat] [libseat/libseat.c:76] Backend 'logind' failed to open seat, skipping
00:00:00.014 [INFO] [wlr] [libseat] [seatd/seat.c:39] Created VT-bound seat seat0
00:00:00.015 [INFO] [wlr] [libseat] [seatd/server.c:145] New client connected (pid: 1028, uid: 1000, gid: 100)
00:00:00.015 [INFO] [wlr] [libseat] [libseat/backend/seatd.c:633] Started embedded seatd
00:00:00.015 [ERROR] [wlr] [libseat] [common/terminal.c:162] Could not open target tty: Permission denied
00:00:00.015 [ERROR] [wlr] [libseat] [seatd/seat.c:61] Could not open tty0 to update VT: Permission denied
00:00:00.015 [INFO] [wlr] [libseat] [seatd/seat.c:170] Added client 0 to seat0
00:00:00.015 [ERROR] [wlr] [libseat] [common/terminal.c:162] Could not open target tty: Permission denied
00:00:00.015 [ERROR] [wlr] [libseat] [seatd/seat.c:72] Could not open terminal for VT 0: Permission denied
00:00:00.015 [ERROR] [wlr] [libseat] [seatd/seat.c:461] Could not open VT for client
00:00:00.015 [ERROR] [wlr] [libseat] [common/terminal.c:162] Could not open target tty: Permission denied
00:00:00.015 [ERROR] [wlr] [libseat] [seatd/seat.c:86] Could not open terminal to clean up VT 0: Permission denied
00:00:00.015 [INFO] [wlr] [libseat] [libseat/libseat.c:73] Seat opened with backend 'builtin'
00:00:00.015 [INFO] [wlr] [backend/session/session.c:110] Successfully loaded libseat session
00:00:00.016 [INFO] [wlr] [backend/backend.c:91] Waiting for a session to become active
00:00:10.026 [ERROR] [wlr] [backend/backend.c:114] Timeout waiting session to become active
00:00:10.026 [ERROR] [wlr] [backend/backend.c:352] Failed to start a DRM session
00:00:10.026 [ERROR] [sway/server.c:56] Unable to create backend
00:00:10.029 [INFO] [wlr] [libseat] [seatd/client.c:471] Client disconnected
00:00:10.029 [ERROR] [wlr] [libseat] [common/terminal.c:162] Could not open target tty: Permission denied
00:00:10.029 [ERROR] [wlr] [libseat] [seatd/seat.c:86] Could not open terminal to clean up VT 0: Permission denied
00:00:10.029 [INFO] [wlr] [libseat] [seatd/seat.c:524] Closed client 0 on seat0
00:00:10.029 [INFO] [wlr] [libseat] [seatd/seat.c:192] Removed client 0 from seat0
00:00:10.029 [INFO] [wlr] [libseat] [libseat/backend/seatd.c:645] Stopped embedded seatd
I did some reading, and it looks like the seatd
warning about not finding a socket is fine. So the first error is [wlr] [libseat] [common/terminal.c:162] Could not open target tty: Permission denied
. I found this thread which seems to have a similar issue, but I’m not sure how to apply the information there to a NixOS setup.
These are the sway-relevant bits of my config:
# home.nix
...
# Enable Sway
wayland.windowManager.sway = {
enable = true;
wrapperFeatures.gtk = true;
config = {
startup = [
# https://github.com/NixOS/nixpkgs/issues/119445
{command = "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK";}
];
terminal = "kitty";
menu = "wofi --show run";
# Display device configuration
output = {
eDP-1 = {
# Set HIDP scale (pixel integer scaling)
scale = "2";
};
};
};
};
...
# configuration.nix
...
hardware.opengl = {
enable = true;
driSupport = true;
};
users.users = {
logan = {
isNormalUser = true;
extraGroups = [
"wheel"
"video"
"audio"
];
};
};
xdg.portal = {
enable = true;
wlr.enable = true;
};
...
Thank you!