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

34 lines
732 B
Nix
Raw Normal View History

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