{ config, pkgs, lib, ... }:
{
  config = lib.mkIf config.system.desktop.enable {
    services.displayManager.ly = {
      enable = true;
      settings = {
	vi_mode = true;
        waylandsessions = "/etc/greetd/environments";
      };
    };

    environment.etc = {
      "greetd/environments/sway.desktop".text = ''
        [Desktop Entry]
        Name=Sway
        Exec=sway --unsupported-gpu
      '';
      "greetd/environments/niri.desktop".text = ''
        [Desktop Entry]
        Name=Niri
        Exec=niri-session
      '';
    };
  };
}
