2024-11-04 22:41:38 -05:00
|
|
|
{ config, pkgs, ... }:
|
2024-10-09 03:36:08 -04:00
|
|
|
{
|
2024-12-03 16:50:23 -05:00
|
|
|
services.greetd = {
|
2024-11-04 22:41:38 -05:00
|
|
|
enable = config.system.desktop.enable;
|
2024-11-02 17:19:40 -04:00
|
|
|
restart = true;
|
|
|
|
settings = {
|
|
|
|
terminal = {
|
|
|
|
vt = 2;
|
|
|
|
switch = true;
|
|
|
|
};
|
2024-12-04 00:46:02 -05:00
|
|
|
default_session.command = "${pkgs.greetd.tuigreet}/bin/tuigreet";
|
2024-09-02 19:07:17 -04:00
|
|
|
};
|
|
|
|
};
|
2024-12-03 16:50:23 -05:00
|
|
|
|
|
|
|
environment.etc."greetd/environments".text = let
|
|
|
|
initScript = ''
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
in ''
|
|
|
|
${pkgs.writeScript "startsway" ''
|
|
|
|
${initScript}
|
|
|
|
export QT_QPA_PLATFORM="wayland;xcb"
|
|
|
|
export XDG_CURRENT_DESKTOP=sway
|
|
|
|
sway --unsupported-gpu
|
|
|
|
''}
|
|
|
|
${pkgs.writeScript "startniri" ''
|
|
|
|
${initScript}
|
|
|
|
export QT_QPA_PLATFORM=wayland
|
|
|
|
export XDG_CURRENT_DESKTOP=niri
|
|
|
|
niri-session
|
|
|
|
''}
|
|
|
|
'';
|
2024-09-02 19:07:17 -04:00
|
|
|
}
|