forked from mirrors/nixpkgs
Merge pull request #31268 from Ma27/x11-defaults
services.xserver: fix defaults of X11
This commit is contained in:
commit
c9b8bbd039
|
@ -100,6 +100,14 @@ following incompatible changes:</para>
|
|||
to connect to hidden networks.
|
||||
</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>
|
||||
</itemizedlist>
|
||||
|
||||
</section>
|
||||
|
|
|
@ -87,11 +87,11 @@ in
|
|||
|
||||
default = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
example = "none";
|
||||
default = "none";
|
||||
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.";
|
||||
|
|
|
@ -161,6 +161,15 @@ 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;
|
||||
|
@ -552,6 +561,11 @@ 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 =
|
||||
|
|
Loading…
Reference in a new issue