{
  pkgs,
  config,
  lib,
  ...
}:
let
  cfg = config.jade.desktop.dm;
in
with lib;
{
  options.jade.desktop.dm.autoLogin = {
    enable = mkEnableOption "Enable Autologin";
    delay = mkOption {
      type = types.int;
      default = 0;
    };
  };
  config.services = {
    displayManager = {
      autoLogin = {
        enable = cfg.autoLogin.enable;
        user = "jade";
      };
      defaultSession = "niri";
    };
    xserver.displayManager.gdm = {
      enable = true;
      banner = "Meow :3";
      autoLogin = {
        delay = cfg.autoLogin.delay;
      };
    };
  };
}
