about summary refs log tree commit diff
path: root/nixos/modules/services/x11/desktop-managers/default.nix
diff options
context:
space:
mode:
authorRyan Mulligan <ryan@ryantm.com>2016-01-31 12:57:47 -0800
committerRyan Mulligan <ryan@ryantm.com>2016-01-31 13:00:15 -0800
commit8fee229261b16d3e937e091308d07bcea751bd34 (patch)
tree453902ee3128ebf077a151aeb0019e311a77228f /nixos/modules/services/x11/desktop-managers/default.nix
parent698b14c1c9843e7e5b6e0e5c50baac060694f8bc (diff)
downloadnixlib-8fee229261b16d3e937e091308d07bcea751bd34.tar
nixlib-8fee229261b16d3e937e091308d07bcea751bd34.tar.gz
nixlib-8fee229261b16d3e937e091308d07bcea751bd34.tar.bz2
nixlib-8fee229261b16d3e937e091308d07bcea751bd34.tar.lz
nixlib-8fee229261b16d3e937e091308d07bcea751bd34.tar.xz
nixlib-8fee229261b16d3e937e091308d07bcea751bd34.tar.zst
nixlib-8fee229261b16d3e937e091308d07bcea751bd34.zip
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";
Diffstat (limited to 'nixos/modules/services/x11/desktop-managers/default.nix')
-rw-r--r--nixos/modules/services/x11/desktop-managers/default.nix8
1 files changed, 7 insertions, 1 deletions
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}
+            '';
       };
 
     };