{ config, pkgs, lib, ... }: { options.tuigreet = { enable = lib.mkEnableOption "enables tuigreet with greetd"; }; config = lib.mkIf config.tuigreet.enable { services.greetd = let wm = if config.hyprland.enable then "Hyprland" else (if config.niri.enable then "niri" else null); in { enable = true; package = pkgs.greetd.tuigreet; settings = { terminal = { vt = 2; }; default_session = lib.mkIf (wm != null) { command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd ${wm}"; user = "greeter"; }; }; }; }; }