Merge pull request #311376 from SuperSandro2000/display-managers-misc

nixos/display.managers: use cfg where possible
This commit is contained in:
Nick Cao 2024-05-14 09:36:02 -04:00 committed by GitHub
commit ff610bbb02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -113,7 +113,7 @@ in
type = lib.types.nullOr lib.types.str // {
description = "session name";
check = d:
lib.assertMsg (d != null -> (lib.types.str.check d && lib.elem d config.services.displayManager.sessionData.sessionNames)) ''
lib.assertMsg (d != null -> (lib.types.str.check d && lib.elem d cfg.sessionData.sessionNames)) ''
Default graphical session, '${d}', not found.
Valid names for 'services.displayManager.defaultSession' are:
${lib.concatStringsSep "\n " cfg.sessionData.sessionNames}
@ -187,7 +187,7 @@ in
services.displayManager.sessionData = {
desktops = installedSessions;
sessionNames = lib.concatMap (p: p.providedSessions) config.services.displayManager.sessionPackages;
sessionNames = lib.concatMap (p: p.providedSessions) cfg.sessionPackages;
# We do not want to force users to set defaultSession when they have only single DE.
autologinSession =
if cfg.defaultSession != null then