Revert restrictive validation behavior for DM/WM defaults in the X module

The original idea behind this change (described in ticket #11064) was to
improve the assertions to avoid that users of the X server accidentally
forget to configure a DM or WM.

However this caused several issues with setups that require X, but no DM
or WM. The keymap testcases became instable as well as now disabling DMs
needs to be done explicitly.
(see https://github.com/NixOS/nixpkgs/pull/31268#issuecomment-347080036)

In the end the idea behind the change and #11064 was obviously a
mistake, so reverting it completely for now should be fine.

authored by

Maximilian Bosch and committed by
Herwig Hochleitner
5caa22fe 6e8a13f7

+4 -29
-9
nixos/doc/manual/release-notes/rl-1803.xml
··· 420 420 </listitem> 421 421 <listitem> 422 422 <para> 423 - The option <option>services.xserver.desktopManager.default</option> is now 424 - <literal>none</literal> by default. An assertion failure is thrown if WM's 425 - and DM's default are <literal>none</literal>. 426 - To explicitly run a plain X session without and DM or WM, the newly 427 - introduced option <option>services.xserver.plainX</option> must be set to true. 428 - </para> 429 - </listitem> 430 - <listitem> 431 - <para> 432 423 The option <option>services.logstash.listenAddress</option> is now <literal>127.0.0.1</literal> by default. 433 424 Previously the default behaviour was to listen on all interfaces. 434 425 </para>
+3 -3
nixos/modules/services/x11/desktop-managers/default.nix
··· 87 87 88 88 default = mkOption { 89 89 type = types.str; 90 - default = "none"; 91 - example = "plasma5"; 90 + default = ""; 91 + example = "none"; 92 92 description = "Default desktop manager loaded if none have been chosen."; 93 93 apply = defaultDM: 94 - if defaultDM == "none" && cfg.session.list != [] then 94 + if defaultDM == "" && cfg.session.list != [] then 95 95 (head cfg.session.list).name 96 96 else if any (w: w.name == defaultDM) cfg.session.list then 97 97 defaultDM
+1 -3
nixos/modules/services/x11/window-managers/default.nix
··· 62 62 example = "wmii"; 63 63 description = "Default window manager loaded if none have been chosen."; 64 64 apply = defaultWM: 65 - if defaultWM == "none" && cfg.session != [] then 66 - (head cfg.session).name 67 - else if any (w: w.name == defaultWM) cfg.session then 65 + if any (w: w.name == defaultWM) cfg.session then 68 66 defaultWM 69 67 else 70 68 throw "Default window manager (${defaultWM}) not found.";
-14
nixos/modules/services/x11/xserver.nix
··· 161 161 ''; 162 162 }; 163 163 164 - plainX = mkOption { 165 - type = types.bool; 166 - default = false; 167 - description = '' 168 - Whether the X11 session can be plain (without DM/WM) and 169 - the Xsession script will be used as fallback or not. 170 - ''; 171 - }; 172 - 173 164 autorun = mkOption { 174 165 type = types.bool; 175 166 default = true; ··· 561 552 + "${toString (length primaryHeads)} heads set to primary: " 562 553 + concatMapStringsSep ", " (x: x.output) primaryHeads; 563 554 }) 564 - { assertion = cfg.desktopManager.default == "none" && cfg.windowManager.default == "none" -> cfg.plainX; 565 - message = "Either the desktop manager or the window manager shouldn't be `none`! " 566 - + "To explicitly allow this, you can also set `services.xserver.plainX` to `true`. " 567 - + "The `default` value looks for enabled WMs/DMs and select the first one."; 568 - } 569 555 ]; 570 556 571 557 environment.etc =