From 2413fcdfebd2179083fbee9e8c50bbde4fb8121e Mon Sep 17 00:00:00 2001 From: volth Date: Sat, 1 Sep 2018 19:27:17 +0000 Subject: services.xserver.windowManager.session: handle duplicate names (#37690) --- .../services/x11/display-managers/default.nix | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'nixos/modules/services/x11/display-managers/default.nix') diff --git a/nixos/modules/services/x11/display-managers/default.nix b/nixos/modules/services/x11/display-managers/default.nix index 66886f23737..f561c5f8b7a 100644 --- a/nixos/modules/services/x11/display-managers/default.nix +++ b/nixos/modules/services/x11/display-managers/default.nix @@ -27,6 +27,15 @@ let Xft.hintstyle: hintslight ''; + mkCases = session: + concatStrings ( + mapAttrsToList (name: starts: '' + (${name}) + ${concatMapStringsSep "\n " (n: n.start) starts} + ;; + '') (lib.groupBy (n: n.name) session) + ); + # file provided by services.xserver.displayManager.session.wrapper xsessionWrapper = pkgs.writeScript "xsession-wrapper" '' @@ -139,21 +148,13 @@ let # Start the window manager. case "$windowManager" in - ${concatMapStrings (s: '' - (${s.name}) - ${s.start} - ;; - '') wm} + ${mkCases wm} (*) echo "$0: Window manager '$windowManager' not found.";; esac # Start the desktop manager. case "$desktopManager" in - ${concatMapStrings (s: '' - (${s.name}) - ${s.start} - ;; - '') dm} + ${mkCases dm} (*) echo "$0: Desktop manager '$desktopManager' not found.";; esac -- cgit 1.4.1