{
  pkgs,
  lib,
  config,
  ...
}: {

  services.greetd = {
    enable = true;

    # tuigreet command to run
    settings = {
      default_session = {
        user = "greeter";
        command = "${pkgs.tuigreet}/bin/tuigreet -c Hyprland -t -r --user-menu --remember-user-session --power-shutdown \"systemctl poweroff\" --power-reboot \"systemctl reboot\"";
      };
    };
  };

  # allow yubikey signin with u2f
  security.pam.services.greetd.u2fAuth = true;

  # ensure the user exists
  users.users.greeter = {
    isSystemUser = true;
    description = "user for greetd";
  };
}
