diff --git a/nixos/modules/services/x11/display-managers/default.nix b/nixos/modules/services/x11/display-managers/default.nix index 035029150c81..047321bd9495 100644 --- a/nixos/modules/services/x11/display-managers/default.nix +++ b/nixos/modules/services/x11/display-managers/default.nix @@ -194,9 +194,12 @@ let ${xorg.lndir}/bin/lndir ${pkg}/share/xsessions $out/share/xsessions '') cfg.displayManager.extraSessionFilePackages} - mkdir -p "$out/share/wayland-sessions" + ${concatMapStrings (pkg: '' - ${xorg.lndir}/bin/lndir ${pkg}/share/wayland-sessions $out/share/wayland-sessions + if test -d ${pkg}/share/wayland-sessions; then + mkdir -p "$out/share/wayland-sessions" + ${xorg.lndir}/bin/lndir ${pkg}/share/wayland-sessions $out/share/wayland-sessions + fi '') cfg.displayManager.extraSessionFilePackages} '';