NixOS-Config/modules/system/desktop/sway/greetd/default.nix

37 lines
844 B
Nix
Raw Normal View History

2024-10-09 03:36:08 -04:00
{ pkgs, ... }:
{
2024-09-02 19:07:17 -04:00
services = {
# Configure greetd for "auto" login (single user only)
2024-10-15 22:41:19 -04:00
greetd = let
startSway = pkgs.writeScript "startsway" ''
if lspci -k | grep "Kernel driver in use: nvidia" &> /dev/null; then
export LIBVA_DRIVER_NAME=nvidia
export GBM_BACKEND=nvidia-drm
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export WLR_NO_HARDWARE_CURSORS=1
else
:
fi
export XDG_CURRENT_DESKTOP=sway
export QT_QPA_PLATFORM="wayland;xcb"
sway --unsupported-gpu
'';
in {
2024-09-02 19:07:17 -04:00
enable = true;
restart = true;
settings = {
terminal = {
vt = 2;
switch = true;
};
default_session = {
2024-10-15 22:41:19 -04:00
command = "${startSway}";
2024-09-02 19:07:17 -04:00
user = "jimbo";
};
};
};
};
}