mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
nixos/displayManager: interpolate option paths in docs + errors
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{
|
||||
config,
|
||||
options,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
@@ -7,6 +8,7 @@
|
||||
|
||||
let
|
||||
cfg = config.services.displayManager;
|
||||
opts = options.services.displayManager;
|
||||
|
||||
installedSessions =
|
||||
pkgs.runCommand "desktops"
|
||||
@@ -79,7 +81,7 @@ in
|
||||
default = config.user != null;
|
||||
defaultText = lib.literalExpression "config.${options.user} != null";
|
||||
description = ''
|
||||
Automatically log in as {option}`autoLogin.user`.
|
||||
Automatically log in as {option}`${options.user}`.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -185,14 +187,14 @@ in
|
||||
{
|
||||
assertion = cfg.autoLogin.enable -> cfg.autoLogin.user != null;
|
||||
message = ''
|
||||
services.displayManager.autoLogin.enable requires services.displayManager.autoLogin.user to be set
|
||||
`${opts.autoLogin}.enable` requires `${opts.autoLogin}.user` to be set
|
||||
'';
|
||||
}
|
||||
{
|
||||
assertion = cfg.defaultSession == null || lib.elem cfg.defaultSession cfg.sessionData.sessionNames;
|
||||
message = ''
|
||||
Default graphical session, '${toString cfg.defaultSession}', not found.
|
||||
Valid names for 'services.displayManager.defaultSession' are:
|
||||
Valid names for `${opts.defaultSession}` are:
|
||||
${lib.concatStringsSep "\n " cfg.sessionData.sessionNames}
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user