summary refs log tree commit diff
path: root/nixos/modules/services/x11/display-managers/gdm.nix
diff options
context:
space:
mode:
authorLuca Bruno <lucabru@src.gnome.org>2015-09-14 08:48:00 +0000
committerLuca Bruno <lucabru@src.gnome.org>2015-09-14 08:48:53 +0000
commitc94a62558524741fedfa82bfd3b3c3cca7c2f59a (patch)
treea353c70f4b9922f609bcf38de4df7d251325f4e8 /nixos/modules/services/x11/display-managers/gdm.nix
parent6644af591035a255cf323d201fe4759eac518423 (diff)
downloadnixpkgs-c94a62558524741fedfa82bfd3b3c3cca7c2f59a.tar
nixpkgs-c94a62558524741fedfa82bfd3b3c3cca7c2f59a.tar.gz
nixpkgs-c94a62558524741fedfa82bfd3b3c3cca7c2f59a.tar.bz2
nixpkgs-c94a62558524741fedfa82bfd3b3c3cca7c2f59a.tar.lz
nixpkgs-c94a62558524741fedfa82bfd3b3c3cca7c2f59a.tar.xz
nixpkgs-c94a62558524741fedfa82bfd3b3c3cca7c2f59a.tar.zst
nixpkgs-c94a62558524741fedfa82bfd3b3c3cca7c2f59a.zip
nixos gdm: use AutomaticLogin if delay is zero. Closes #9843
Diffstat (limited to 'nixos/modules/services/x11/display-managers/gdm.nix')
-rw-r--r--nixos/modules/services/x11/display-managers/gdm.nix18
1 files changed, 13 insertions, 5 deletions
diff --git a/nixos/modules/services/x11/display-managers/gdm.nix b/nixos/modules/services/x11/display-managers/gdm.nix
index 9312f64471a..887b6f88a74 100644
--- a/nixos/modules/services/x11/display-managers/gdm.nix
+++ b/nixos/modules/services/x11/display-managers/gdm.nix
@@ -112,13 +112,21 @@ in
 
     programs.dconf.profiles.gdm = "${gdm}/share/dconf/profile/gdm";
 
+    # Use AutomaticLogin if delay is zero, because it's immediate.
+    # Otherwise with TimedLogin with zero seconds the prompt is still
+    # presented and there's a little delay.
     environment.etc."gdm/custom.conf".text = ''
       [daemon]
-      ${optionalString cfg.gdm.autoLogin.enable ''
-      TimedLoginEnable=true
-      TimedLogin=${cfg.gdm.autoLogin.user}
-      TimedLoginDelay=${toString cfg.gdm.autoLogin.delay}
-      ''}
+      ${optionalString cfg.gdm.autoLogin.enable (
+        if cfg.gdm.autoLogin.delay > 0 then ''
+          TimedLoginEnable=true
+          TimedLogin=${cfg.gdm.autoLogin.user}
+          TimedLoginDelay=${toString cfg.gdm.autoLogin.delay}
+        '' else ''
+          AutomaticLoginEnable=true
+          AutomaticLogin=${cfg.gdm.autoLogin.user}
+        '')
+      }
 
       [security]