Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions nixos/doc/manual/configuration/x-windows.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@
desktop environment. If you wanted no desktop environment and i3 as your your
window manager, you'd define:
<programlisting>
<xref linkend="opt-services.xserver.desktopManager.default"/> = "none";
<xref linkend="opt-services.xserver.windowManager.default"/> = "i3";
<xref linkend="opt-services.xserver.displayManager.defaultSession"/> = "none+i3";
</programlisting>
And, finally, to enable auto-login for a user <literal>johndoe</literal>:
<programlisting>
Expand Down
5 changes: 2 additions & 3 deletions nixos/doc/manual/configuration/xfce.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
<para>
To enable the Xfce Desktop Environment, set
<programlisting>
<link linkend="opt-services.xserver.desktopManager.default">services.xserver.desktopManager</link> = {
<link linkend="opt-services.xserver.desktopManager.xfce.enable">xfce.enable</link> = true;
<link linkend="opt-services.xserver.desktopManager.default">default</link> = "xfce";
<xref linkend="opt-services.xserver.desktopManager.xfce.enable" /> = true;
<xref linkend="opt-services.xserver.displayManager.defaultSession" /> = "xfce";
};
</programlisting>
</para>
Expand Down
13 changes: 13 additions & 0 deletions nixos/doc/manual/release-notes/rl-2003.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@
and adding a <option>--all</option> option which prints all options and their values.
</para>
</listitem>
<listitem>
<para>
<option>services.xserver.desktopManager.default</option> and <option>services.xserver.windowManager.default</option> options were replaced by a single <xref linkend="opt-services.xserver.displayManager.defaultSession"/> option to improve support for upstream session files. If you used something like:
<programlisting>
services.xserver.desktopManager.default = "xfce";
services.xserver.windowManager.default = "icewm";
</programlisting>
you should change it to:
<programlisting>
services.xserver.displayManager.defaultSession = "xfce+icewm";
</programlisting>
</para>
</listitem>
</itemizedlist>
</section>

Expand Down
3 changes: 1 addition & 2 deletions nixos/lib/testing-python.nix
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,8 @@ in rec {
virtualisation.memorySize = 1024;
services.xserver.enable = true;
services.xserver.displayManager.auto.enable = true;
services.xserver.windowManager.default = "icewm";
services.xserver.displayManager.defaultSession = "none+icewm";
services.xserver.windowManager.icewm.enable = true;
services.xserver.desktopManager.default = "none";
};
in
runInMachine ({
Expand Down
3 changes: 1 addition & 2 deletions nixos/lib/testing.nix
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,8 @@ in rec {
virtualisation.memorySize = 1024;
services.xserver.enable = true;
services.xserver.displayManager.auto.enable = true;
services.xserver.windowManager.default = "icewm";
services.xserver.displayManager.defaultSession = "none+icewm";
services.xserver.windowManager.icewm.enable = true;
services.xserver.desktopManager.default = "none";
};
in
runInMachine ({
Expand Down
3 changes: 2 additions & 1 deletion nixos/modules/programs/sway.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ let
swayJoined = pkgs.symlinkJoin {
name = "sway-joined";
paths = [ swayWrapped swayPackage ];
passthru.providedSessions = [ "sway" ];
};
in {
options.programs.sway = {
Expand Down Expand Up @@ -88,7 +89,7 @@ in {
fonts.enableDefaultFonts = mkDefault true;
programs.dconf.enable = mkDefault true;
# To make a Sway session available if a display manager like SDDM is enabled:
services.xserver.displayManager.extraSessionFilePackages = [ swayJoined ];
services.xserver.displayManager.sessionPackages = [ swayJoined ];
};

meta.maintainers = with lib.maintainers; [ gnidorah primeos colemickens ];
Expand Down
23 changes: 7 additions & 16 deletions nixos/modules/services/x11/desktop-managers/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,14 @@ in
};

default = mkOption {
type = types.str;
default = "";
type = types.nullOr types.str;
default = null;
example = "none";
description = "Default desktop manager loaded if none have been chosen.";
apply = defaultDM:
if defaultDM == "" && cfg.session.list != [] then
(head cfg.session.list).name
else if any (w: w.name == defaultDM) cfg.session.list then
defaultDM
else
builtins.trace ''
Default desktop manager (${defaultDM}) not found at evaluation time.
These are the known valid session names:
${concatMapStringsSep "\n " (w: "services.xserver.desktopManager.default = \"${w.name}\";") cfg.session.list}
It's also possible the default can be found in one of these packages:
${concatMapStringsSep "\n " (p: p.name) config.services.xserver.displayManager.extraSessionFilePackages}
'' defaultDM;
description = ''
<emphasis role="strong">Deprecated</emphasis>, please use <xref linkend="opt-services.xserver.displayManager.defaultSession"/> instead.

Default desktop manager loaded if none have been chosen.
'';
};

};
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/services/x11/desktop-managers/gnome3.nix
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ in
services.gnome3.core-shell.enable = true;
services.gnome3.core-utilities.enable = mkDefault true;

services.xserver.displayManager.extraSessionFilePackages = [ pkgs.gnome3.gnome-session ];
services.xserver.displayManager.sessionPackages = [ pkgs.gnome3.gnome-session ];

environment.extraInit = ''
${concatMapStrings (p: ''
Expand All @@ -171,7 +171,7 @@ in
})

(mkIf flashbackEnabled {
services.xserver.displayManager.extraSessionFilePackages = map
services.xserver.displayManager.sessionPackages = map
(wm: pkgs.gnome3.gnome-flashback.mkSessionForWm {
inherit (wm) wmName wmLabel wmCommand;
}) (optional cfg.flashback.enableMetacity {
Expand Down
8 changes: 4 additions & 4 deletions nixos/modules/services/x11/desktop-managers/pantheon.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ in

config = mkIf cfg.enable {

services.xserver.displayManager.extraSessionFilePackages = [ pkgs.pantheon.elementary-session-settings ];
services.xserver.displayManager.sessionPackages = [ pkgs.pantheon.elementary-session-settings ];

# Ensure lightdm is used when Pantheon is enabled
# Without it screen locking will be nonfunctional because of the use of lightlocker
Expand All @@ -81,9 +81,9 @@ in

services.xserver.displayManager.lightdm.greeters.pantheon.enable = mkDefault true;

# If not set manually Pantheon session cannot be started
# Known issue of https://github.com/NixOS/nixpkgs/pull/43992
services.xserver.desktopManager.default = mkForce "pantheon";
# Without this, Elementary LightDM greeter will pre-select non-existent `default` session
# https://github.com/elementary/greeter/issues/368
services.xserver.displayManager.defaultSession = "pantheon";

services.xserver.displayManager.sessionCommands = ''
if test "$XDG_CURRENT_DESKTOP" = "Pantheon"; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ in {
};

config = mkIf cfg.enable {
services.xserver.displayManager.extraSessionFilePackages = [
services.xserver.displayManager.sessionPackages = [
pkgs.surf-display
];

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{ accountsservice
, glib
, gobject-introspection
, python3
, wrapGAppsHook
}:

python3.pkgs.buildPythonApplication {
name = "set-session";

format = "other";

src = ./set-session.py;

dontUnpack = true;

strictDeps = false;

nativeBuildInputs = [
wrapGAppsHook
gobject-introspection
];

buildInputs = [
accountsservice
glib
];

propagatedBuildInputs = with python3.pkgs; [
pygobject3
ordered-set
];

installPhase = ''
mkdir -p $out/bin
cp $src $out/bin/set-session
chmod +x $out/bin/set-session
'';
}
Loading