From 8fee229261b16d3e937e091308d07bcea751bd34 Mon Sep 17 00:00:00 2001 From: Ryan Mulligan Date: Sun, 31 Jan 2016 12:57:47 -0800 Subject: [PATCH] desktop manager service: fix and improve default error Before the error if the wrong default desktop was chosen would be: /nixpkgs-channels/lib/modules.nix:282:11: Default desktop manager ($(defaultDM)) not found. which has the string interpolation done incorreclty. Now that is fixed and it is more user-friendly as: /nixpkgs-channels/lib/modules.nix:282:11: Default desktop manager (gnome) not found. Probably you want to change services.xserver.desktopManager.default = "gnome"; to one of services.xserver.desktopManager.default = "gnome3"; services.xserver.desktopManager.default = "none"; --- nixos/modules/services/x11/desktop-managers/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/x11/desktop-managers/default.nix b/nixos/modules/services/x11/desktop-managers/default.nix index 998bcd354c53..3e91450a39d2 100644 --- a/nixos/modules/services/x11/desktop-managers/default.nix +++ b/nixos/modules/services/x11/desktop-managers/default.nix @@ -64,7 +64,13 @@ in else if any (w: w.name == defaultDM) cfg.session.list then defaultDM else - throw "Default desktop manager ($(defaultDM)) not found."; + throw '' + Default desktop manager (${defaultDM}) not found. + Probably you want to change + services.xserver.desktopManager.default = "${defaultDM}"; + to one of + ${concatMapStringsSep "\n " (w: "services.xserver.desktopManager.default = \"${w.name}\";") cfg.session.list} + ''; }; };