anchor.diff:    lightdmConf = writeText "lightdm.conf"
       ''
         [LightDM]
  -      greeter-user = ${config.users.extraUsers.lightdm.name}
  -      greeters-directory = ${cfg.greeter.package}
  +      ${optionalString cfg.greeter.enable ''
  +        greeter-user = ${config.users.extraUsers.lightdm.name}
  +        greeters-directory = ${cfg.greeter.package}
  +      ''}
         sessions-directory = ${dmcfg.session.desktops}
   
         [Seat:*]
         xserver-command = ${xserverWrapper}
         session-wrapper = ${dmcfg.session.script}
  -      greeter-session = ${cfg.greeter.name}
  +      ${optionalString cfg.greeter.enable ''
  +        greeter-session = ${cfg.greeter.name}
  +      ''}
  +      ${optionalString cfg.autoLogin.enable ''
  +        autologin-user = ${cfg.autoLogin.user}
  +        autologin-user-timeout = ${toString cfg.autoLogin.timeout}
  +        autologin-session = ${defaultSessionName}
  +      ''}
         ${cfg.extraSeatDefaults}
       '';
  +
  +  defaultSessionName =
  +    let
  +      dm = xcfg.desktopManager.default;
  +      wm = xcfg.windowManager.default;
  +    in dm + optionalString (wm != "none") (" + " + wm);
   in
   {
     # Note: the order in which lightdm greeter modules are imported
  
positive.code:         description = "Extra lines to append to SeatDefaults section.";
        };
  
      };
    };
  
    config = mkIf cfg.enable {
      services.xserver.displayManager.slim.enable = false;
  
      services.xserver.displayManager.job = {
  
negative.code: 
  let
  
    xcfg = config.services.xserver;
    dmcfg = xcfg.displayManager;
    xEnv = config.systemd.services."display-manager".environment;
    cfg = dmcfg.lightdm;
  
  