From bd9c5b933cfe4b3bc71b962fe6436f5d373c3b29 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 6 Feb 2020 02:17:09 +0100 Subject: [PATCH] nixos/services.xserver: Fix legacy options for default wm without dm We switched to unified default session option services.xserver.displayManager.defaultSession and included fallback path for the legacy options. Unfortunately when only services.xserver.windowManager.default is set and not services.xserver.desktopManager.default, it got incorrectly converted to the new option. This should fix that. Closes: https://github.com/NixOS/nixpkgs/issues/76684 --- nixos/modules/services/x11/display-managers/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/x11/display-managers/default.nix b/nixos/modules/services/x11/display-managers/default.nix index 1efd0739376..821886e5fda 100644 --- a/nixos/modules/services/x11/display-managers/default.nix +++ b/nixos/modules/services/x11/display-managers/default.nix @@ -141,9 +141,11 @@ let ''; dmDefault = cfg.desktopManager.default; + # fallback default for cases when only default wm is set + dmFallbackDefault = if dmDefault != null then dmDefault else "none"; wmDefault = cfg.windowManager.default; - defaultSessionFromLegacyOptions = concatStringsSep "+" (filter (s: s != null) ([ dmDefault ] ++ optional (wmDefault != "none") wmDefault)); + defaultSessionFromLegacyOptions = dmFallbackDefault + optionalString (wmDefault != null && wmDefault != "none") "+${wmDefault}"; in @@ -358,7 +360,7 @@ in { c = wmDefault; t = "- services.xserver.windowManager.default"; } ]))} Please use - services.xserver.displayManager.defaultSession = "${concatStringsSep "+" (filter (s: s != null) [ dmDefault wmDefault ])}"; + services.xserver.displayManager.defaultSession = "${defaultSessionFromLegacyOptions}"; instead. '' ];