nixos gdm: use AutomaticLogin if delay is zero. Closes #9843

+13 -5
+13 -5
nixos/modules/services/x11/display-managers/gdm.nix
··· 112 112 113 113 programs.dconf.profiles.gdm = "${gdm}/share/dconf/profile/gdm"; 114 114 115 + # Use AutomaticLogin if delay is zero, because it's immediate. 116 + # Otherwise with TimedLogin with zero seconds the prompt is still 117 + # presented and there's a little delay. 115 118 environment.etc."gdm/custom.conf".text = '' 116 119 [daemon] 117 - ${optionalString cfg.gdm.autoLogin.enable '' 118 - TimedLoginEnable=true 119 - TimedLogin=${cfg.gdm.autoLogin.user} 120 - TimedLoginDelay=${toString cfg.gdm.autoLogin.delay} 121 - ''} 120 + ${optionalString cfg.gdm.autoLogin.enable ( 121 + if cfg.gdm.autoLogin.delay > 0 then '' 122 + TimedLoginEnable=true 123 + TimedLogin=${cfg.gdm.autoLogin.user} 124 + TimedLoginDelay=${toString cfg.gdm.autoLogin.delay} 125 + '' else '' 126 + AutomaticLoginEnable=true 127 + AutomaticLogin=${cfg.gdm.autoLogin.user} 128 + '') 129 + } 122 130 123 131 [security] 124 132