mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 01:13:05 +00:00
nixos/xserver: Remove {desktop,window}Manager.default options
These have been deprecated since NixOS 20.03.
Also fixes evaluation error caused by moving
the `defaultSessionFromLegacyOptions` variable
in 6be2bfcc32
This commit is contained in:
parent
499f723873
commit
8bf5752a3c
@ -29,12 +29,6 @@ let
|
||||
fi
|
||||
'') cfg.sessionPackages}
|
||||
'';
|
||||
|
||||
dmDefault = config.services.xserver.desktopManager.default;
|
||||
# fallback default for cases when only default wm is set
|
||||
dmFallbackDefault = if dmDefault != null then dmDefault else "none";
|
||||
wmDefault = config.services.xserver.windowManager.default;
|
||||
defaultSessionFromLegacyOptions = dmFallbackDefault + lib.optionalString (wmDefault != null && wmDefault != "none") "+${wmDefault}";
|
||||
in
|
||||
{
|
||||
options = {
|
||||
@ -125,14 +119,7 @@ in
|
||||
${lib.concatStringsSep "\n " cfg.displayManager.sessionData.sessionNames}
|
||||
'';
|
||||
};
|
||||
default =
|
||||
if dmDefault != null || wmDefault != null then
|
||||
defaultSessionFromLegacyOptions
|
||||
else
|
||||
null;
|
||||
defaultText = lib.literalMD ''
|
||||
Taken from display manager settings or window manager settings, if either is set.
|
||||
'';
|
||||
default = null;
|
||||
example = "gnome";
|
||||
description = ''
|
||||
Graphical session to pre-select in the session chooser (only effective for GDM, LightDM and SDDM).
|
||||
@ -192,20 +179,6 @@ in
|
||||
}
|
||||
];
|
||||
|
||||
warnings =
|
||||
lib.mkIf (dmDefault != null || wmDefault != null) [
|
||||
''
|
||||
The following options are deprecated:
|
||||
${lib.concatStringsSep "\n " (map ({c, t}: t) (lib.filter ({c, t}: c != null) [
|
||||
{ c = dmDefault; t = "- services.xserver.desktopManager.default"; }
|
||||
{ c = wmDefault; t = "- services.xserver.windowManager.default"; }
|
||||
]))}
|
||||
Please use
|
||||
services.displayManager.defaultSession = "${defaultSessionFromLegacyOptions}";
|
||||
instead.
|
||||
''
|
||||
];
|
||||
|
||||
# Make xsessions and wayland sessions available in XDG_DATA_DIRS
|
||||
# as some programs have behavior that depends on them being present
|
||||
environment.sessionVariables.XDG_DATA_DIRS = lib.mkIf (cfg.sessionPackages != [ ]) [
|
||||
|
@ -82,17 +82,6 @@ in
|
||||
});
|
||||
};
|
||||
|
||||
default = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
example = "none";
|
||||
description = ''
|
||||
**Deprecated**, please use [](#opt-services.displayManager.defaultSession) instead.
|
||||
|
||||
Default desktop manager loaded if none have been chosen.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -222,13 +222,6 @@ in
|
||||
};
|
||||
|
||||
config = {
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.desktopManager.default != null || cfg.windowManager.default != null -> cfg.displayManager.defaultSession == defaultSessionFromLegacyOptions;
|
||||
message = "You cannot use both services.displayManager.defaultSession option and legacy options (services.xserver.desktopManager.default and services.xserver.windowManager.default).";
|
||||
}
|
||||
];
|
||||
|
||||
services.displayManager.sessionData.wrapper = xsessionWrapper;
|
||||
|
||||
services.xserver.displayManager.xserverBin = "${xorg.xorgserver.out}/bin/X";
|
||||
|
@ -72,17 +72,6 @@ in
|
||||
});
|
||||
};
|
||||
|
||||
default = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
example = "wmii";
|
||||
description = ''
|
||||
**Deprecated**, please use [](#opt-services.displayManager.defaultSession) instead.
|
||||
|
||||
Default window manager loaded if none have been chosen.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user