diff --git a/docs/dankgreeter/nixos.mdx b/docs/dankgreeter/nixos.mdx index f8c1124..0c221d5 100644 --- a/docs/dankgreeter/nixos.mdx +++ b/docs/dankgreeter/nixos.mdx @@ -111,6 +111,28 @@ When using the flake package with the native nixpkgs module, some dependencies m ::: +## Auto-login + +DankGreeter can skip the login screen and launch a session automatically on +boot using the standard NixOS display-manager options: + +```nix +services.displayManager = { + autoLogin = { + enable = true; + user = "yourusername"; + }; + + # Required for auto-login: identifies which session to launch. + # Use the .desktop basename without the extension (e.g. "niri", "hyprland"). + defaultSession = "niri"; +}; +``` + +`defaultSession` (or at least one entry in +`services.displayManager.sessionPackages`) is required — the module needs to +know which session to start, and will fail to build otherwise. + ## Rebuilding After making configuration changes, don't forget to rebuild your configuration: diff --git a/versioned_docs/version-1.4/dankgreeter/nixos.mdx b/versioned_docs/version-1.4/dankgreeter/nixos.mdx index 51396df..58d8a1e 100644 --- a/versioned_docs/version-1.4/dankgreeter/nixos.mdx +++ b/versioned_docs/version-1.4/dankgreeter/nixos.mdx @@ -111,6 +111,37 @@ When using the flake package with the native nixpkgs module, some dependencies m ::: +## Auto-login + +DankGreeter can skip the login screen and launch a session automatically on +boot using the standard NixOS display-manager options: + +```nix +services.displayManager = { + autoLogin = { + enable = true; + user = "yourusername"; + }; + + # Required for auto-login: identifies which session to launch. + # Use the .desktop basename without the extension (e.g. "niri", "hyprland"). + defaultSession = "niri"; +}; +``` + +`defaultSession` (or at least one entry in +`services.displayManager.sessionPackages`) is required — the module needs to +know which session to start, and will fail to build otherwise. + +:::tip + +The session launch command is resolved declaratively from your current session +packages, so it stays correct across rebuilds and won't break after +`nix-collect-garbage`. Prefer this over the greeter's remembered-session +auto-login on NixOS. + +::: + ## Rebuilding After making configuration changes, don't forget to rebuild your configuration: