services.xserver: fix `apply` of default DM/WM

This is needed to pick the first enabled DM/WM
if the default is `none`
wip/yesman
Maximilian Bosch 7 years ago
parent 5b70c1855b
commit 410f0f0db2
No known key found for this signature in database
GPG Key ID: 091DBF4D1FC46B8E
  1. 2
      nixos/modules/services/x11/desktop-managers/default.nix
  2. 4
      nixos/modules/services/x11/window-managers/default.nix
  3. 4
      nixos/modules/services/x11/xserver.nix

@ -91,7 +91,7 @@ in
example = "plasma5";
description = "Default desktop manager loaded if none have been chosen.";
apply = defaultDM:
if defaultDM == "" && cfg.session.list != [] then
if defaultDM == "none" && cfg.session.list != [] then
(head cfg.session.list).name
else if any (w: w.name == defaultDM) cfg.session.list then
defaultDM

@ -61,7 +61,9 @@ in
example = "wmii";
description = "Default window manager loaded if none have been chosen.";
apply = defaultWM:
if any (w: w.name == defaultWM) cfg.session then
if defaultWM == "none" && cfg.session != [] then
(head cfg.session).name
else if any (w: w.name == defaultWM) cfg.session then
defaultWM
else
throw "Default window manager (${defaultWM}) not found.";

@ -562,7 +562,9 @@ in
+ concatMapStringsSep ", " (x: x.output) primaryHeads;
})
{ assertion = cfg.desktopManager.default == "none" && cfg.windowManager.default == "none" -> cfg.plainX;
message = "Either the desktop manager or the window manager shouldn't be `none`! To explicitly allow this, you can also set `services.xserver.plainX` to `true`.";
message = "Either the desktop manager or the window manager shouldn't be `none`! "
+ "To explicitly allow this, you can also set `services.xserver.plainX` to `true`. "
+ "The `default` value looks for enabled WMs/DMs and select the first one.";
}
];

Loading…
Cancel
Save