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

nixos/display.managers: use cfg where possible

Nick Cao ff610bbb 7cc87c70

Changed files
+2 -2
nixos
modules
services
display-managers
+2 -2
nixos/modules/services/display-managers/default.nix
···
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}
···
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