Skip to content

Commit

Permalink
Revert restrictive validation behavior for DM/WM defaults in the X mo…
Browse files Browse the repository at this point in the history
…dule

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 #31268 (comment))

In the end the idea behind the change and #11064 was obviously a
mistake, so reverting it completely for now should be fine.
  • Loading branch information
Ma27 authored and bendlas committed Mar 28, 2018
1 parent 6e8a13f commit 5caa22f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 29 deletions.
9 changes: 0 additions & 9 deletions nixos/doc/manual/release-notes/rl-1803.xml
Expand Up @@ -418,15 +418,6 @@ following incompatible changes:</para>
have been added to set up static routing.
</para>
</listitem>
<listitem>
<para>
The option <option>services.xserver.desktopManager.default</option> is now
<literal>none</literal> by default. An assertion failure is thrown if WM's
and DM's default are <literal>none</literal>.
To explicitly run a plain X session without and DM or WM, the newly
introduced option <option>services.xserver.plainX</option> must be set to true.
</para>
</listitem>
<listitem>
<para>
The option <option>services.logstash.listenAddress</option> is now <literal>127.0.0.1</literal> by default.
Expand Down
6 changes: 3 additions & 3 deletions nixos/modules/services/x11/desktop-managers/default.nix
Expand Up @@ -87,11 +87,11 @@ in

default = mkOption {
type = types.str;
default = "none";
example = "plasma5";
default = "";
example = "none";
description = "Default desktop manager loaded if none have been chosen.";
apply = defaultDM:
if defaultDM == "none" && cfg.session.list != [] then
if defaultDM == "" && cfg.session.list != [] then
(head cfg.session.list).name
else if any (w: w.name == defaultDM) cfg.session.list then
defaultDM
Expand Down
4 changes: 1 addition & 3 deletions nixos/modules/services/x11/window-managers/default.nix
Expand Up @@ -62,9 +62,7 @@ in
example = "wmii";
description = "Default window manager loaded if none have been chosen.";
apply = defaultWM:
if defaultWM == "none" && cfg.session != [] then
(head cfg.session).name
else if any (w: w.name == defaultWM) cfg.session then
if any (w: w.name == defaultWM) cfg.session then
defaultWM
else
throw "Default window manager (${defaultWM}) not found.";
Expand Down
14 changes: 0 additions & 14 deletions nixos/modules/services/x11/xserver.nix
Expand Up @@ -161,15 +161,6 @@ in
'';
};

plainX = mkOption {
type = types.bool;
default = false;
description = ''
Whether the X11 session can be plain (without DM/WM) and
the Xsession script will be used as fallback or not.
'';
};

autorun = mkOption {
type = types.bool;
default = true;
Expand Down Expand Up @@ -561,11 +552,6 @@ in
+ "${toString (length primaryHeads)} heads set to primary: "
+ 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`. "
+ "The `default` value looks for enabled WMs/DMs and select the first one.";
}
];

environment.etc =
Expand Down

0 comments on commit 5caa22f

Please sign in to comment.