From 6be2bfcc32d5ee203acf3b85354f5028c8bb50eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 27 Feb 2024 10:06:13 +0100 Subject: [PATCH 1/5] nixos/display-managers: extract generic display-manager bits Some settings which where before inside the xserver module, are generic and also required for SDDM under wayland. To make them easily re-usable lets extract them. --- nixos/modules/module-list.nix | 1 + .../services/display-managers/default.nix | 257 ++++++++++++++++++ .../services/x11/display-managers/default.nix | 213 +-------------- .../services/x11/display-managers/sddm.nix | 18 +- nixos/modules/services/x11/xserver.nix | 10 +- 5 files changed, 274 insertions(+), 225 deletions(-) create mode 100644 nixos/modules/services/display-managers/default.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index b361e9ee5e41d..e6f3153d3b7ea 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -508,6 +508,7 @@ ./services/development/nixseparatedebuginfod.nix ./services/development/rstudio-server/default.nix ./services/development/zammad.nix + ./services/display-managers/default.nix ./services/display-managers/greetd.nix ./services/editors/emacs.nix ./services/editors/haste.nix diff --git a/nixos/modules/services/display-managers/default.nix b/nixos/modules/services/display-managers/default.nix new file mode 100644 index 0000000000000..93c4e481e5304 --- /dev/null +++ b/nixos/modules/services/display-managers/default.nix @@ -0,0 +1,257 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.services.displayManager; + + installedSessions = pkgs.runCommand "desktops" + { # trivial derivation + preferLocalBuild = true; + allowSubstitutes = false; + } + '' + mkdir -p "$out/share/"{xsessions,wayland-sessions} + + ${lib.concatMapStrings (pkg: '' + for n in ${lib.concatStringsSep " " pkg.providedSessions}; do + if ! test -f ${pkg}/share/wayland-sessions/$n.desktop -o \ + -f ${pkg}/share/xsessions/$n.desktop; then + echo "Couldn't find provided session name, $n.desktop, in session package ${pkg.name}:" + echo " ${pkg}" + return 1 + fi + done + + if test -d ${pkg}/share/xsessions; then + ${pkgs.buildPackages.xorg.lndir}/bin/lndir ${pkg}/share/xsessions $out/share/xsessions + fi + if test -d ${pkg}/share/wayland-sessions; then + ${pkgs.buildPackages.xorg.lndir}/bin/lndir ${pkg}/share/wayland-sessions $out/share/wayland-sessions + 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 = { + services.displayManager = { + enable = lib.mkEnableOption "systemd's display-manager service"; + + preStart = lib.mkOption { + type = lib.types.lines; + default = ""; + example = "rm -f /var/log/my-display-manager.log"; + description = lib.mdDoc "Script executed before the display manager is started."; + }; + + execCmd = lib.mkOption { + type = lib.types.str; + example = lib.literalExpression ''"''${pkgs.lightdm}/bin/lightdm"''; + description = lib.mdDoc "Command to start the display manager."; + }; + + environment = lib.mkOption { + type = with lib.types; attrsOf unspecified; + default = {}; + description = lib.mdDoc "Additional environment variables needed by the display manager."; + }; + + hiddenUsers = lib.mkOption { + type = with lib.types; listOf str; + default = [ "nobody" ]; + description = lib.mdDoc '' + A list of users which will not be shown in the display manager. + ''; + }; + + logToFile = lib.mkOption { + type = lib.types.bool; + default = false; + description = lib.mdDoc '' + Whether the display manager redirects the output of the + session script to {file}`~/.xsession-errors`. + ''; + }; + + logToJournal = lib.mkOption { + type = lib.types.bool; + default = true; + description = lib.mdDoc '' + Whether the display manager redirects the output of the + session script to the systemd journal. + ''; + }; + + # Configuration for automatic login. Common for all DM. + autoLogin = lib.mkOption { + type = lib.types.submodule ({ config, options, ... }: { + options = { + enable = lib.mkOption { + type = lib.types.bool; + default = config.user != null; + defaultText = lib.literalExpression "config.${options.user} != null"; + description = lib.mdDoc '' + Automatically log in as {option}`autoLogin.user`. + ''; + }; + + user = lib.mkOption { + type = with lib.types; nullOr str; + default = null; + description = lib.mdDoc '' + User to be used for the automatic login. + ''; + }; + }; + }); + + default = {}; + description = lib.mdDoc '' + Auto login configuration attrset. + ''; + }; + + defaultSession = lib.mkOption { + type = lib.types.nullOr lib.types.str // { + description = "session name"; + check = d: + lib.assertMsg (d != null -> (lib.types.str.check d && lib.elem d config.services.displayManager.sessionData.sessionNames)) '' + Default graphical session, '${d}', not found. + Valid names for 'services.xserver.displayManager.defaultSession' are: + ${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. + ''; + example = "gnome"; + description = lib.mdDoc '' + Graphical session to pre-select in the session chooser (only effective for GDM, LightDM and SDDM). + + On GDM, LightDM and SDDM, it will also be used as a session for auto-login. + ''; + }; + + sessionData = lib.mkOption { + description = lib.mdDoc "Data exported for display managers’ convenience"; + internal = true; + default = {}; + }; + + sessionPackages = lib.mkOption { + type = lib.types.listOf (lib.types.package // { + description = "package with provided sessions"; + check = p: lib.assertMsg + (lib.types.package.check p && p ? providedSessions + && p.providedSessions != [] && lib.all lib.isString p.providedSessions) + '' + Package, '${p.name}', did not specify any session names, as strings, in + 'passthru.providedSessions'. This is required when used as a session package. + + The session names can be looked up in: + ${p}/share/xsessions + ${p}/share/wayland-sessions + ''; + }); + default = []; + description = lib.mdDoc '' + A list of packages containing x11 or wayland session files to be passed to the display manager. + ''; + }; + }; + }; + + imports = [ + (lib.mkRenamedOptionModule [ "services" "xserver" "displayManager" "autoLogin" ] [ "services" "displayManager" "autoLogin" ]) + (lib.mkRenamedOptionModule [ "services" "xserver" "displayManager" "defaultSession" ] [ "services" "displayManager" "defaultSession" ]) + (lib.mkRenamedOptionModule [ "services" "xserver" "displayManager" "job" "environment" ] [ "services" "displayManager" "environment" ]) + (lib.mkRenamedOptionModule [ "services" "xserver" "displayManager" "job" "execCmd" ] [ "services" "displayManager" "execCmd" ]) + (lib.mkRenamedOptionModule [ "services" "xserver" "displayManager" "job" "logToFile" ] [ "services" "displayManager" "logToFile" ]) + (lib.mkRenamedOptionModule [ "services" "xserver" "displayManager" "job" "logToJournal" ] [ "services" "displayManager" "logToJournal" ]) + (lib.mkRenamedOptionModule [ "services" "xserver" "displayManager" "job" "preStart" ] [ "services" "displayManager" "preStart" ]) + ]; + + config = lib.mkIf cfg.enable { + assertions = [ + { assertion = cfg.autoLogin.enable -> cfg.autoLogin.user != null; + message = '' + services.displayManager.autoLogin.enable requires services.displayManager.autoLogin.user to be set + ''; + } + ]; + + 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 != [ ]) [ + "${cfg.sessionData.desktops}/share" + ]; + + services.displayManager.sessionData = { + desktops = installedSessions; + sessionNames = lib.concatMap (p: p.providedSessions) config.services.displayManager.sessionPackages; + # We do not want to force users to set defaultSession when they have only single DE. + autologinSession = + if cfg.defaultSession != null then + cfg.defaultSession + else if cfg.sessionData.sessionNames != [] then + lib.head cfg.sessionData.sessionNames + else + null; + }; + + # so that the service won't be enabled when only startx is used + systemd.services.display-manager.enable = + let dmConf = config.services.xserver.displayManager; + noDmUsed = !(dmConf.gdm.enable + || dmConf.sddm.enable + || dmConf.xpra.enable + || dmConf.lightdm.enable); + in lib.mkIf noDmUsed (lib.mkDefault false); + + systemd.services.display-manager = { + description = "Display Manager"; + after = [ "acpid.service" "systemd-logind.service" "systemd-user-sessions.service" ]; + restartIfChanged = false; + + environment = lib.optionalAttrs config.hardware.opengl.setLdLibraryPath { + LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.addOpenGLRunpath.driverLink ]; + } // cfg.environment; + + preStart = cfg.preStart; + script = lib.mkIf (config.systemd.services.display-manager.enable == true) cfg.execCmd; + + # Stop restarting if the display manager stops (crashes) 2 times + # in one minute. Starting X typically takes 3-4s. + startLimitIntervalSec = 30; + startLimitBurst = 3; + serviceConfig = { + Restart = "always"; + RestartSec = "200ms"; + SyslogIdentifier = "display-manager"; + }; + }; + }; +} diff --git a/nixos/modules/services/x11/display-managers/default.nix b/nixos/modules/services/x11/display-managers/default.nix index c22048c6692e9..5e2d1bf39abf3 100644 --- a/nixos/modules/services/x11/display-managers/default.nix +++ b/nixos/modules/services/x11/display-managers/default.nix @@ -14,7 +14,6 @@ with lib; let cfg = config.services.xserver; - opt = options.services.xserver; xorg = pkgs.xorg; fontconfig = config.fonts.fontconfig; @@ -130,41 +129,6 @@ let exit 1 fi ''; - - installedSessions = pkgs.runCommand "desktops" - { # trivial derivation - preferLocalBuild = true; - allowSubstitutes = false; - } - '' - mkdir -p "$out/share/"{xsessions,wayland-sessions} - - ${concatMapStrings (pkg: '' - for n in ${concatStringsSep " " pkg.providedSessions}; do - if ! test -f ${pkg}/share/wayland-sessions/$n.desktop -o \ - -f ${pkg}/share/xsessions/$n.desktop; then - echo "Couldn't find provided session name, $n.desktop, in session package ${pkg.name}:" - echo " ${pkg}" - return 1 - fi - done - - if test -d ${pkg}/share/xsessions; then - ${pkgs.buildPackages.xorg.lndir}/bin/lndir ${pkg}/share/xsessions $out/share/xsessions - fi - if test -d ${pkg}/share/wayland-sessions; then - ${pkgs.buildPackages.xorg.lndir}/bin/lndir ${pkg}/share/wayland-sessions $out/share/wayland-sessions - fi - '') cfg.displayManager.sessionPackages} - ''; - - dmDefault = cfg.desktopManager.default; - # fallback default for cases when only default wm is set - dmFallbackDefault = if dmDefault != null then dmDefault else "none"; - wmDefault = cfg.windowManager.default; - - defaultSessionFromLegacyOptions = dmFallbackDefault + optionalString (wmDefault != null && wmDefault != "none") "+${wmDefault}"; - in { @@ -215,35 +179,6 @@ in ''; }; - hiddenUsers = mkOption { - type = types.listOf types.str; - default = [ "nobody" ]; - description = lib.mdDoc '' - A list of users which will not be shown in the display manager. - ''; - }; - - sessionPackages = mkOption { - type = with types; listOf (package // { - description = "package with provided sessions"; - check = p: assertMsg - (package.check p && p ? providedSessions - && p.providedSessions != [] && all isString p.providedSessions) - '' - Package, '${p.name}', did not specify any session names, as strings, in - 'passthru.providedSessions'. This is required when used as a session package. - - The session names can be looked up in: - ${p}/share/xsessions - ${p}/share/wayland-sessions - ''; - }); - default = []; - description = lib.mdDoc '' - A list of packages containing x11 or wayland session files to be passed to the display manager. - ''; - }; - session = mkOption { default = []; type = types.listOf types.attrs; @@ -274,51 +209,6 @@ in ''; }; - sessionData = mkOption { - description = lib.mdDoc "Data exported for display managers’ convenience"; - internal = true; - default = {}; - apply = val: { - wrapper = xsessionWrapper; - desktops = installedSessions; - sessionNames = concatMap (p: p.providedSessions) cfg.displayManager.sessionPackages; - # We do not want to force users to set defaultSession when they have only single DE. - autologinSession = - if cfg.displayManager.defaultSession != null then - cfg.displayManager.defaultSession - else if cfg.displayManager.sessionData.sessionNames != [] then - head cfg.displayManager.sessionData.sessionNames - else - null; - }; - }; - - defaultSession = mkOption { - type = with types; nullOr str // { - description = "session name"; - check = d: - assertMsg (d != null -> (str.check d && elem d cfg.displayManager.sessionData.sessionNames)) '' - Default graphical session, '${d}', not found. - Valid names for 'services.xserver.displayManager.defaultSession' are: - ${concatStringsSep "\n " cfg.displayManager.sessionData.sessionNames} - ''; - }; - default = - if dmDefault != null || wmDefault != null then - defaultSessionFromLegacyOptions - else - null; - defaultText = literalMD '' - Taken from display manager settings or window manager settings, if either is set. - ''; - example = "gnome"; - description = lib.mdDoc '' - Graphical session to pre-select in the session chooser (only effective for GDM, LightDM and SDDM). - - On GDM, LightDM and SDDM, it will also be used as a session for auto-login. - ''; - }; - importedVariables = mkOption { type = types.listOf (types.strMatching "[a-zA-Z_][a-zA-Z0-9_]*"); visible = false; @@ -327,106 +217,19 @@ in ''; }; - job = { - - preStart = mkOption { - type = types.lines; - default = ""; - example = "rm -f /var/log/my-display-manager.log"; - description = lib.mdDoc "Script executed before the display manager is started."; - }; - - execCmd = mkOption { - type = types.str; - example = literalExpression ''"''${pkgs.lightdm}/bin/lightdm"''; - description = lib.mdDoc "Command to start the display manager."; - }; - - environment = mkOption { - type = types.attrsOf types.unspecified; - default = {}; - description = lib.mdDoc "Additional environment variables needed by the display manager."; - }; - - logToFile = mkOption { - type = types.bool; - default = false; - description = lib.mdDoc '' - Whether the display manager redirects the output of the - session script to {file}`~/.xsession-errors`. - ''; - }; - - logToJournal = mkOption { - type = types.bool; - default = true; - description = lib.mdDoc '' - Whether the display manager redirects the output of the - session script to the systemd journal. - ''; - }; - - }; - - # Configuration for automatic login. Common for all DM. - autoLogin = mkOption { - type = types.submodule ({ config, options, ... }: { - options = { - enable = mkOption { - type = types.bool; - default = config.user != null; - defaultText = literalExpression "config.${options.user} != null"; - description = lib.mdDoc '' - Automatically log in as {option}`autoLogin.user`. - ''; - }; - - user = mkOption { - type = types.nullOr types.str; - default = null; - description = lib.mdDoc '' - User to be used for the automatic login. - ''; - }; - }; - }); - - default = {}; - description = lib.mdDoc '' - Auto login configuration attrset. - ''; - }; - }; }; config = { assertions = [ - { assertion = cfg.displayManager.autoLogin.enable -> cfg.displayManager.autoLogin.user != null; - message = '' - services.xserver.displayManager.autoLogin.enable requires services.xserver.displayManager.autoLogin.user to be set - ''; - } { assertion = cfg.desktopManager.default != null || cfg.windowManager.default != null -> cfg.displayManager.defaultSession == defaultSessionFromLegacyOptions; message = "You cannot use both services.xserver.displayManager.defaultSession option and legacy options (services.xserver.desktopManager.default and services.xserver.windowManager.default)."; } ]; - warnings = - mkIf (dmDefault != null || wmDefault != null) [ - '' - The following options are deprecated: - ${concatStringsSep "\n " (map ({c, t}: t) (filter ({c, t}: c != null) [ - { c = dmDefault; t = "- services.xserver.desktopManager.default"; } - { c = wmDefault; t = "- services.xserver.windowManager.default"; } - ]))} - Please use - services.xserver.displayManager.defaultSession = "${defaultSessionFromLegacyOptions}"; - instead. - '' - ]; + services.displayManager.sessionData.wrapper = xsessionWrapper; services.xserver.displayManager.xserverBin = "${xorg.xorgserver.out}/bin/X"; @@ -449,7 +252,7 @@ in # Create desktop files and scripts for starting sessions for WMs/DMs # that do not have upstream session files (those defined using services.{display,desktop,window}Manager.session options). - services.xserver.displayManager.sessionPackages = + services.displayManager.sessionPackages = let dms = filter (s: s.manage == "desktop") cfg.displayManager.session; wms = filter (s: s.manage == "window") cfg.displayManager.session; @@ -511,20 +314,14 @@ in ) (cartesianProductOfSets { dm = dms; wm = wms; }) ); - - # 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.displayManager.sessionPackages != [ ]) [ - "${cfg.displayManager.sessionData.desktops}/share" - ]; }; imports = [ (mkRemovedOptionModule [ "services" "xserver" "displayManager" "desktopManagerHandlesLidAndPower" ] "The option is no longer necessary because all display managers have already delegated lid management to systemd.") - (mkRenamedOptionModule [ "services" "xserver" "displayManager" "job" "logsXsession" ] [ "services" "xserver" "displayManager" "job" "logToFile" ]) - (mkRenamedOptionModule [ "services" "xserver" "displayManager" "logToJournal" ] [ "services" "xserver" "displayManager" "job" "logToJournal" ]) - (mkRenamedOptionModule [ "services" "xserver" "displayManager" "extraSessionFilesPackages" ] [ "services" "xserver" "displayManager" "sessionPackages" ]) + (mkRenamedOptionModule [ "services" "xserver" "displayManager" "job" "logsXsession" ] [ "services" "displayManager" "logToFile" ]) + (mkRenamedOptionModule [ "services" "xserver" "displayManager" "logToJournal" ] [ "services" "displayManager" "logToJournal" ]) + (mkRenamedOptionModule [ "services" "xserver" "displayManager" "extraSessionFilesPackages" ] [ "services" "displayManager" "sessionPackages" ]) ]; } diff --git a/nixos/modules/services/x11/display-managers/sddm.nix b/nixos/modules/services/x11/display-managers/sddm.nix index a315a3ebf3224..97351c5fd9fb9 100644 --- a/nixos/modules/services/x11/display-managers/sddm.nix +++ b/nixos/modules/services/x11/display-managers/sddm.nix @@ -129,17 +129,17 @@ in { imports = [ (mkRemovedOptionModule - [ "services" "xserver" "displayManager" "sddm" "themes" ] - "Set the option `services.xserver.displayManager.sddm.package' instead.") + [ "services" "displayManager" "sddm" "themes" ] + "Set the option `services.displayManager.sddm.package' instead.") (mkRenamedOptionModule - [ "services" "xserver" "displayManager" "sddm" "autoLogin" "enable" ] - [ "services" "xserver" "displayManager" "autoLogin" "enable" ]) + [ "services" "displayManager" "sddm" "autoLogin" "enable" ] + [ "services" "displayManager" "autoLogin" "enable" ]) (mkRenamedOptionModule - [ "services" "xserver" "displayManager" "sddm" "autoLogin" "user" ] - [ "services" "xserver" "displayManager" "autoLogin" "user" ]) + [ "services" "displayManager" "sddm" "autoLogin" "user" ] + [ "services" "displayManager" "autoLogin" "user" ]) (mkRemovedOptionModule - [ "services" "xserver" "displayManager" "sddm" "extraConfig" ] - "Set the option `services.xserver.displayManager.sddm.settings' instead.") + [ "services" "displayManager" "sddm" "extraConfig" ] + "Set the option `services.displayManager.sddm.settings' instead.") ]; options = { @@ -281,6 +281,8 @@ in } ]; + services.displayManager.execCmd = "exec /run/current-system/sw/bin/sddm"; + security.pam.services = { sddm.text = '' auth substack login diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index c5b168e608a4d..c513bc64724fc 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -639,6 +639,7 @@ in ###### implementation config = mkIf cfg.enable { + services.displayManager.enable = true; services.xserver.displayManager.lightdm.enable = let dmConf = cfg.displayManager; @@ -650,15 +651,6 @@ in || config.services.greetd.enable); in mkIf (default) (mkDefault true); - # so that the service won't be enabled when only startx is used - systemd.services.display-manager.enable = - let dmConf = cfg.displayManager; - noDmUsed = !(dmConf.gdm.enable - || dmConf.sddm.enable - || dmConf.xpra.enable - || dmConf.lightdm.enable); - in mkIf (noDmUsed) (mkDefault false); - hardware.opengl.enable = mkDefault true; services.xserver.videoDrivers = mkIf (cfg.videoDriver != null) [ cfg.videoDriver ]; From 0d3ab0d4ece5941c4a2e5a7db4d6897375b0c27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 27 Feb 2024 09:57:54 +0100 Subject: [PATCH 2/5] nixos/sddm: move option from services.xserver.displayManager.sddm to services.displayManager.sddm Because it is not just X anymore --- nixos/modules/module-list.nix | 2 +- .../{x11 => }/display-managers/sddm.nix | 23 +++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) rename nixos/modules/services/{x11 => }/display-managers/sddm.nix (84%) diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index e6f3153d3b7ea..49948fce6f3f5 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -510,6 +510,7 @@ ./services/development/zammad.nix ./services/display-managers/default.nix ./services/display-managers/greetd.nix + ./services/display-managers/sddm.nix ./services/editors/emacs.nix ./services/editors/haste.nix ./services/editors/infinoted.nix @@ -1445,7 +1446,6 @@ ./services/x11/display-managers/default.nix ./services/x11/display-managers/gdm.nix ./services/x11/display-managers/lightdm.nix - ./services/x11/display-managers/sddm.nix ./services/x11/display-managers/slim.nix ./services/x11/display-managers/startx.nix ./services/x11/display-managers/sx.nix diff --git a/nixos/modules/services/x11/display-managers/sddm.nix b/nixos/modules/services/display-managers/sddm.nix similarity index 84% rename from nixos/modules/services/x11/display-managers/sddm.nix rename to nixos/modules/services/display-managers/sddm.nix index 97351c5fd9fb9..cf8892a816bdc 100644 --- a/nixos/modules/services/x11/display-managers/sddm.nix +++ b/nixos/modules/services/display-managers/sddm.nix @@ -3,7 +3,7 @@ let xcfg = config.services.xserver; dmcfg = xcfg.displayManager; - cfg = dmcfg.sddm; + cfg = config.services.displayManager.sddm; xEnv = config.systemd.services.display-manager.environment; sddm = cfg.package.override (old: { @@ -128,6 +128,19 @@ let in { imports = [ + (mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "autoLogin" "minimumUid" ] [ "services" "displayManager" "sddm" "autoLogin" "minimumUid" ]) + (mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "autoLogin" "relogin" ] [ "services" "displayManager" "sddm" "autoLogin" "relogin" ]) + (mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "autoNumlock" ] [ "services" "displayManager" "sddm" "autoNumlock" ]) + (mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "enable" ] [ "services" "displayManager" "sddm" "enable" ]) + (mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "enableHidpi" ] [ "services" "displayManager" "sddm" "enableHidpi" ]) + (mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "extraPackages" ] [ "services" "displayManager" "sddm" "extraPackages" ]) + (mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "package" ] [ "services" "displayManager" "sddm" "package" ]) + (mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "settings" ] [ "services" "displayManager" "sddm" "settings" ]) + (mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "setupScript" ] [ "services" "displayManager" "sddm" "setupScript" ]) + (mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "stopScript" ] [ "services" "displayManager" "sddm" "stopScript" ]) + (mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "theme" ] [ "services" "displayManager" "sddm" "theme" ]) + (mkRenamedOptionModule [ "services" "xserver" "displayManager" "sddm" "wayland" "enable" ] [ "services" "displayManager" "sddm" "wayland" "enable" ]) + (mkRemovedOptionModule [ "services" "displayManager" "sddm" "themes" ] "Set the option `services.displayManager.sddm.package' instead.") @@ -144,7 +157,7 @@ in options = { - services.xserver.displayManager.sddm = { + services.displayManager.sddm = { enable = mkOption { type = types.bool; default = false; @@ -281,7 +294,10 @@ in } ]; - services.displayManager.execCmd = "exec /run/current-system/sw/bin/sddm"; + services.displayManager = { + enable = true; + execCmd = "exec /run/current-system/sw/bin/sddm"; + }; security.pam.services = { sddm.text = '' @@ -340,7 +356,6 @@ in services = { dbus.packages = [ sddm ]; xserver = { - displayManager.job.execCmd = "exec /run/current-system/sw/bin/sddm"; # To enable user switching, allow sddm to allocate TTYs/displays dynamically. tty = null; display = null; From d220d8bb6fa4b0c6c1275c1e9389b2210e13e32b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 27 Feb 2024 09:59:17 +0100 Subject: [PATCH 3/5] nixos/sddm: allow running on wayland without xserver enabled --- nixos/modules/services/display-managers/sddm.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/display-managers/sddm.nix b/nixos/modules/services/display-managers/sddm.nix index cf8892a816bdc..750b35ba72aa5 100644 --- a/nixos/modules/services/display-managers/sddm.nix +++ b/nixos/modules/services/display-managers/sddm.nix @@ -281,9 +281,9 @@ in assertions = [ { - assertion = xcfg.enable; + assertion = xcfg.enable || cfg.wayland.enable; message = '' - SDDM requires services.xserver.enable to be true + SDDM requires either services.xserver.enable or services.xserver.displayManager.sddm.wayland.enable to be true ''; } { From 5598d81e949c37d5b8668182dea1a4418f209ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 24 Mar 2024 16:51:18 +0100 Subject: [PATCH 4/5] nixos/graphical-desktop: extract generic graphical things from xserver This is required to fix the keymap in SDDM without X. --- nixos/modules/module-list.nix | 1 + .../services/misc/graphical-desktop.nix | 54 +++++++++++++++++++ nixos/modules/services/x11/xserver.nix | 35 ------------ 3 files changed, 55 insertions(+), 35 deletions(-) create mode 100644 nixos/modules/services/misc/graphical-desktop.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 49948fce6f3f5..9fc036f9213a5 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -710,6 +710,7 @@ ./services/misc/gogs.nix ./services/misc/gollum.nix ./services/misc/gpsd.nix + ./services/misc/graphical-desktop.nix ./services/misc/greenclip.nix ./services/misc/guix ./services/misc/headphones.nix diff --git a/nixos/modules/services/misc/graphical-desktop.nix b/nixos/modules/services/misc/graphical-desktop.nix new file mode 100644 index 0000000000000..a88c02e610bf4 --- /dev/null +++ b/nixos/modules/services/misc/graphical-desktop.nix @@ -0,0 +1,54 @@ +{ + config, + lib, + pkgs, + ... +}: +let + xcfg = config.services.xserver; + dmcfg = config.services.displayManager; +in +{ + config = lib.mkIf (xcfg.enable || dmcfg.enable) { + # The default max inotify watches is 8192. + # Nowadays most apps require a good number of inotify watches, + # the value below is used by default on several other distros. + boot.kernel.sysctl = { + "fs.inotify.max_user_instances" = lib.mkDefault 524288; + "fs.inotify.max_user_watches" = lib.mkDefault 524288; + }; + + environment = { + # localectl looks into 00-keyboard.conf + etc."X11/xorg.conf.d/00-keyboard.conf".text = '' + Section "InputClass" + Identifier "Keyboard catchall" + MatchIsKeyboard "on" + Option "XkbModel" "${xcfg.xkb.model}" + Option "XkbLayout" "${xcfg.xkb.layout}" + Option "XkbOptions" "${xcfg.xkb.options}" + Option "XkbVariant" "${xcfg.xkb.variant}" + EndSection + ''; + systemPackages = with pkgs; [ + nixos-icons # needed for gnome and pantheon about dialog, nixos-manual and maybe more + xdg-utils + ]; + }; + + fonts.enableDefaultPackages = lib.mkDefault true; + + hardware.opengl.enable = lib.mkDefault true; + + programs.gnupg.agent.pinentryPackage = lib.mkOverride 1100 pkgs.pinentry-gnome3; + + systemd.defaultUnit = lib.mkIf (xcfg.autorun || dmcfg.enable) "graphical.target"; + + xdg = { + autostart.enable = true; + menus.enable = true; + mime.enable = true; + icons.enable = true; + }; + }; +} diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index c513bc64724fc..f7ca08678e708 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -651,8 +651,6 @@ in || config.services.greetd.enable); in mkIf (default) (mkDefault true); - hardware.opengl.enable = mkDefault true; - services.xserver.videoDrivers = mkIf (cfg.videoDriver != null) [ cfg.videoDriver ]; # FIXME: somehow check for unknown driver names. @@ -686,19 +684,6 @@ in # -xkbdir command line option does not seems to be passed to xkbcomp. "X11/xkb".source = "${cfg.xkb.dir}"; }) - # localectl looks into 00-keyboard.conf - //{ - "X11/xorg.conf.d/00-keyboard.conf".text = '' - Section "InputClass" - Identifier "Keyboard catchall" - MatchIsKeyboard "on" - Option "XkbModel" "${cfg.xkb.model}" - Option "XkbLayout" "${cfg.xkb.layout}" - Option "XkbOptions" "${cfg.xkb.options}" - Option "XkbVariant" "${cfg.xkb.variant}" - EndSection - ''; - } # Needed since 1.18; see https://bugs.freedesktop.org/show_bug.cgi?id=89023#c5 // (let cfgPath = "X11/xorg.conf.d/10-evdev.conf"; in { @@ -718,31 +703,12 @@ in xorg.xprop xorg.xauth pkgs.xterm - pkgs.xdg-utils xorg.xf86inputevdev.out # get evdev.4 man page - pkgs.nixos-icons # needed for gnome and pantheon about dialog, nixos-manual and maybe more ] config.services.xserver.excludePackages ++ optional (elem "virtualbox" cfg.videoDrivers) xorg.xrefresh; environment.pathsToLink = [ "/share/X11" ]; - xdg = { - autostart.enable = true; - menus.enable = true; - mime.enable = true; - icons.enable = true; - }; - - # The default max inotify watches is 8192. - # Nowadays most apps require a good number of inotify watches, - # the value below is used by default on several other distros. - boot.kernel.sysctl."fs.inotify.max_user_instances" = mkDefault 524288; - boot.kernel.sysctl."fs.inotify.max_user_watches" = mkDefault 524288; - - programs.gnupg.agent.pinentryPackage = lib.mkOverride 1100 pkgs.pinentry-gnome3; - - systemd.defaultUnit = mkIf cfg.autorun "graphical.target"; - systemd.services.display-manager = { description = "Display Manager"; @@ -902,7 +868,6 @@ in ${cfg.extraConfig} ''; - fonts.enableDefaultPackages = mkDefault true; fonts.packages = [ (if cfg.upscaleDefaultCursor then fontcursormisc_hidpi else pkgs.xorg.fontcursormisc) pkgs.xorg.fontmiscmisc From 476b8c276e2ae4c98efd1d8d759029e170c5ca98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 27 Feb 2024 21:28:05 +0100 Subject: [PATCH 5/5] treewide: rename renamed sddm/displayManager settings --- .../configuration/modularity.section.md | 2 +- .../configuration/profiles/demo.section.md | 2 +- .../profiles/graphical.section.md | 2 +- .../manual/configuration/x-windows.chapter.md | 8 ++--- .../doc/manual/configuration/xfce.chapter.md | 2 +- ...tallation-cd-graphical-calamares-gnome.nix | 29 +++++++++---------- ...llation-cd-graphical-calamares-plasma5.nix | 20 ++++++------- ...llation-cd-graphical-calamares-plasma6.nix | 18 +++++------- .../installation-cd-graphical-gnome.nix | 28 +++++++++--------- .../installation-cd-graphical-plasma5.nix | 20 ++++++------- nixos/modules/installer/virtualbox-demo.nix | 2 +- nixos/modules/programs/miriway.nix | 2 +- nixos/modules/programs/steam.nix | 2 +- nixos/modules/programs/wayland/cardboard.nix | 2 +- nixos/modules/programs/wayland/hyprland.nix | 2 +- nixos/modules/programs/wayland/labwc.nix | 2 +- nixos/modules/programs/wayland/river.nix | 2 +- nixos/modules/programs/wayland/sway.nix | 2 +- nixos/modules/programs/wayland/wayfire.nix | 2 +- nixos/modules/rename.nix | 2 +- .../services/desktop-managers/plasma6.nix | 4 +-- .../services/display-managers/default.nix | 4 +-- .../services/display-managers/sddm.nix | 14 ++++----- nixos/modules/services/system/nix-daemon.nix | 2 +- .../services/x11/desktop-managers/budgie.nix | 2 +- .../x11/desktop-managers/cinnamon.nix | 2 +- .../services/x11/desktop-managers/deepin.nix | 4 +-- .../services/x11/desktop-managers/default.nix | 2 +- .../x11/desktop-managers/enlightenment.nix | 2 +- .../services/x11/desktop-managers/gnome.nix | 4 +-- .../services/x11/desktop-managers/lumina.nix | 2 +- .../services/x11/desktop-managers/mate.nix | 4 +-- .../x11/desktop-managers/pantheon.nix | 4 +-- .../services/x11/desktop-managers/phosh.nix | 2 +- .../services/x11/desktop-managers/plasma5.nix | 12 ++++---- .../x11/desktop-managers/surf-display.nix | 2 +- .../services/x11/display-managers/default.nix | 6 ++-- .../services/x11/display-managers/gdm.nix | 20 ++++++------- .../lightdm-greeters/mini.nix | 2 +- .../lightdm-greeters/tiny.nix | 4 +-- .../services/x11/display-managers/lightdm.nix | 20 ++++++------- .../services/x11/display-managers/xpra.nix | 2 +- .../services/x11/window-managers/default.nix | 2 +- .../services/x11/window-managers/ragnarwm.nix | 2 +- nixos/modules/services/x11/xserver.nix | 8 ++--- .../modules/testing/test-instrumentation.nix | 2 +- nixos/release.nix | 2 +- nixos/tests/ayatana-indicators.nix | 2 +- nixos/tests/cinnamon-wayland.nix | 2 +- nixos/tests/common/auto.nix | 10 +++---- nixos/tests/common/x11.nix | 2 +- nixos/tests/gnome-flashback.nix | 11 +++---- nixos/tests/gnome-xorg.nix | 11 +++---- nixos/tests/gnome.nix | 9 +++--- nixos/tests/herbstluftwm.nix | 2 +- nixos/tests/i3wm.nix | 2 +- nixos/tests/lightdm.nix | 2 +- nixos/tests/maestral.nix | 9 ++++-- nixos/tests/mate-wayland.nix | 2 +- nixos/tests/miriway.nix | 6 ++-- nixos/tests/nimdow.nix | 2 +- nixos/tests/plasma-bigscreen.nix | 6 ++-- nixos/tests/plasma5-systemd-start.nix | 9 ++++-- nixos/tests/plasma5.nix | 6 ++-- nixos/tests/plasma6.nix | 8 ++--- nixos/tests/ragnarwm.nix | 2 +- nixos/tests/sddm.nix | 8 ++--- nixos/tests/wmderland.nix | 2 +- nixos/tests/xfce.nix | 10 +++---- nixos/tests/xmonad-xdg-autostart.nix | 2 +- nixos/tests/xmonad.nix | 2 +- 71 files changed, 202 insertions(+), 212 deletions(-) diff --git a/nixos/doc/manual/configuration/modularity.section.md b/nixos/doc/manual/configuration/modularity.section.md index cb9f543797d2a..ba3bc79a36311 100644 --- a/nixos/doc/manual/configuration/modularity.section.md +++ b/nixos/doc/manual/configuration/modularity.section.md @@ -27,7 +27,7 @@ Here, we include two modules from the same directory, `vpn.nix` and { config, pkgs, ... }: { services.xserver.enable = true; - services.xserver.displayManager.sddm.enable = true; + services.displayManager.sddm.enable = true; services.xserver.desktopManager.plasma5.enable = true; environment.systemPackages = [ pkgs.vim ]; } diff --git a/nixos/doc/manual/configuration/profiles/demo.section.md b/nixos/doc/manual/configuration/profiles/demo.section.md index 0a0df483c1235..720fc101dc188 100644 --- a/nixos/doc/manual/configuration/profiles/demo.section.md +++ b/nixos/doc/manual/configuration/profiles/demo.section.md @@ -1,4 +1,4 @@ # Demo {#sec-profile-demo} This profile just enables a `demo` user, with password `demo`, uid `1000`, `wheel` group and -[autologin in the SDDM display manager](#opt-services.xserver.displayManager.autoLogin). +[autologin in the SDDM display manager](#opt-services.displayManager.autoLogin). diff --git a/nixos/doc/manual/configuration/profiles/graphical.section.md b/nixos/doc/manual/configuration/profiles/graphical.section.md index aaea5c8c02887..3bd80b52e845a 100644 --- a/nixos/doc/manual/configuration/profiles/graphical.section.md +++ b/nixos/doc/manual/configuration/profiles/graphical.section.md @@ -4,7 +4,7 @@ Defines a NixOS configuration with the Plasma 5 desktop. It's used by the graphical installation CD. It sets [](#opt-services.xserver.enable), -[](#opt-services.xserver.displayManager.sddm.enable), +[](#opt-services.displayManager.sddm.enable), [](#opt-services.xserver.desktopManager.plasma5.enable), and [](#opt-services.xserver.libinput.enable) to true. It also includes glxinfo and firefox in the system packages list. diff --git a/nixos/doc/manual/configuration/x-windows.chapter.md b/nixos/doc/manual/configuration/x-windows.chapter.md index 8162e38e9f5bc..c09e0877e8663 100644 --- a/nixos/doc/manual/configuration/x-windows.chapter.md +++ b/nixos/doc/manual/configuration/x-windows.chapter.md @@ -45,7 +45,7 @@ alternative one by picking one of the following lines: ```nix { - services.xserver.displayManager.sddm.enable = true; + services.displayManager.sddm.enable = true; services.xserver.displayManager.gdm.enable = true; } ``` @@ -99,7 +99,7 @@ your window manager, you'd define: ```nix { - services.xserver.displayManager.defaultSession = "none+i3"; + services.displayManager.defaultSession = "none+i3"; } ``` @@ -109,8 +109,8 @@ using lightdm for a user `alice`: ```nix { services.xserver.displayManager.lightdm.enable = true; - services.xserver.displayManager.autoLogin.enable = true; - services.xserver.displayManager.autoLogin.user = "alice"; + services.displayManager.autoLogin.enable = true; + services.displayManager.autoLogin.user = "alice"; } ``` diff --git a/nixos/doc/manual/configuration/xfce.chapter.md b/nixos/doc/manual/configuration/xfce.chapter.md index fcc9bcc456410..302cf9fa093d1 100644 --- a/nixos/doc/manual/configuration/xfce.chapter.md +++ b/nixos/doc/manual/configuration/xfce.chapter.md @@ -5,7 +5,7 @@ To enable the Xfce Desktop Environment, set ```nix { services.xserver.desktopManager.xfce.enable = true; - services.xserver.displayManager.defaultSession = "xfce"; + services.displayManager.defaultSession = "xfce"; } ``` diff --git a/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-gnome.nix b/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-gnome.nix index d1a4c27432c2b..1de5ba113875a 100644 --- a/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-gnome.nix +++ b/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-gnome.nix @@ -35,20 +35,19 @@ QT_QPA_PLATFORM = "$([[ $XDG_SESSION_TYPE = \"wayland\" ]] && echo \"wayland\")"; }; - services.xserver.displayManager = { - gdm = { - enable = true; - # autoSuspend makes the machine automatically suspend after inactivity. - # It's possible someone could/try to ssh'd into the machine and obviously - # have issues because it's inactive. - # See: - # * https://github.com/NixOS/nixpkgs/pull/63790 - # * https://gitlab.gnome.org/GNOME/gnome-control-center/issues/22 - autoSuspend = false; - }; - autoLogin = { - enable = true; - user = "nixos"; - }; + services.xserver.displayManager.gdm = { + enable = true; + # autoSuspend makes the machine automatically suspend after inactivity. + # It's possible someone could/try to ssh'd into the machine and obviously + # have issues because it's inactive. + # See: + # * https://github.com/NixOS/nixpkgs/pull/63790 + # * https://gitlab.gnome.org/GNOME/gnome-control-center/issues/22 + autoSuspend = false; + }; + + services.displayManager.autoLogin = { + enable = true; + user = "nixos"; }; } diff --git a/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-plasma5.nix b/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-plasma5.nix index a4c46d58c85a4..61e94ffed8894 100644 --- a/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-plasma5.nix +++ b/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-plasma5.nix @@ -8,18 +8,16 @@ isoImage.edition = "plasma5"; - services.xserver = { - desktopManager.plasma5 = { - enable = true; - }; + services.xserver.desktopManager.plasma5 = { + enable = true; + }; - # Automatically login as nixos. - displayManager = { - sddm.enable = true; - autoLogin = { - enable = true; - user = "nixos"; - }; + # Automatically login as nixos. + services.displayManager = { + sddm.enable = true; + autoLogin = { + enable = true; + user = "nixos"; }; }; diff --git a/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-plasma6.nix b/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-plasma6.nix index 11118db3aae2a..bdcf751bf6290 100644 --- a/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-plasma6.nix +++ b/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-plasma6.nix @@ -7,16 +7,14 @@ isoImage.edition = "plasma6"; - services.xserver = { - desktopManager.plasma6.enable = true; - - # Automatically login as nixos. - displayManager = { - sddm.enable = true; - autoLogin = { - enable = true; - user = "nixos"; - }; + services.desktopManager.plasma6.enable = true; + + # Automatically login as nixos. + services.displayManager = { + sddm.enable = true; + autoLogin = { + enable = true; + user = "nixos"; }; }; diff --git a/nixos/modules/installer/cd-dvd/installation-cd-graphical-gnome.nix b/nixos/modules/installer/cd-dvd/installation-cd-graphical-gnome.nix index 573b31b439c2d..b3c605e3f94d1 100644 --- a/nixos/modules/installer/cd-dvd/installation-cd-graphical-gnome.nix +++ b/nixos/modules/installer/cd-dvd/installation-cd-graphical-gnome.nix @@ -16,21 +16,19 @@ enable = true; }; - services.xserver.displayManager = { - gdm = { - enable = true; - # autoSuspend makes the machine automatically suspend after inactivity. - # It's possible someone could/try to ssh'd into the machine and obviously - # have issues because it's inactive. - # See: - # * https://github.com/NixOS/nixpkgs/pull/63790 - # * https://gitlab.gnome.org/GNOME/gnome-control-center/issues/22 - autoSuspend = false; - }; - autoLogin = { - enable = true; - user = "nixos"; - }; + services.xserver.displayManager.gdm = { + enable = true; + # autoSuspend makes the machine automatically suspend after inactivity. + # It's possible someone could/try to ssh'd into the machine and obviously + # have issues because it's inactive. + # See: + # * https://github.com/NixOS/nixpkgs/pull/63790 + # * https://gitlab.gnome.org/GNOME/gnome-control-center/issues/22 + autoSuspend = false; }; + services.displayManager.autoLogin = { + enable = true; + user = "nixos"; + }; } diff --git a/nixos/modules/installer/cd-dvd/installation-cd-graphical-plasma5.nix b/nixos/modules/installer/cd-dvd/installation-cd-graphical-plasma5.nix index 5c7617c9f8c1a..ce111bcebd5c9 100644 --- a/nixos/modules/installer/cd-dvd/installation-cd-graphical-plasma5.nix +++ b/nixos/modules/installer/cd-dvd/installation-cd-graphical-plasma5.nix @@ -8,18 +8,16 @@ isoImage.edition = "plasma5"; - services.xserver = { - desktopManager.plasma5 = { - enable = true; - }; + services.xserver.desktopManager.plasma5 = { + enable = true; + }; - # Automatically login as nixos. - displayManager = { - sddm.enable = true; - autoLogin = { - enable = true; - user = "nixos"; - }; + # Automatically login as nixos. + services.displayManager = { + sddm.enable = true; + autoLogin = { + enable = true; + user = "nixos"; }; }; diff --git a/nixos/modules/installer/virtualbox-demo.nix b/nixos/modules/installer/virtualbox-demo.nix index 01931b2acfca4..289a8cf9e5062 100644 --- a/nixos/modules/installer/virtualbox-demo.nix +++ b/nixos/modules/installer/virtualbox-demo.nix @@ -40,7 +40,7 @@ with lib; # If you prefer another desktop manager or display manager, you may want # to disable the default. # services.xserver.desktopManager.plasma5.enable = lib.mkForce false; - # services.xserver.displayManager.sddm.enable = lib.mkForce false; + # services.displayManager.sddm.enable = lib.mkForce false; # Enable GDM/GNOME by uncommenting above two lines and two lines below. # services.xserver.displayManager.gdm.enable = true; diff --git a/nixos/modules/programs/miriway.nix b/nixos/modules/programs/miriway.nix index e8a10770b6a34..010ab984fc1b0 100644 --- a/nixos/modules/programs/miriway.nix +++ b/nixos/modules/programs/miriway.nix @@ -71,7 +71,7 @@ in { programs.xwayland.enable = lib.mkDefault true; # To make the Miriway session available if a display manager like SDDM is enabled: - services.xserver.displayManager.sessionPackages = [ pkgs.miriway ]; + services.displayManager.sessionPackages = [ pkgs.miriway ]; }; meta.maintainers = with lib.maintainers; [ OPNA2608 ]; diff --git a/nixos/modules/programs/steam.nix b/nixos/modules/programs/steam.nix index bab9bf8107b6e..0fa6b90cfff2a 100644 --- a/nixos/modules/programs/steam.nix +++ b/nixos/modules/programs/steam.nix @@ -161,7 +161,7 @@ in { }; programs.gamescope.enable = mkDefault cfg.gamescopeSession.enable; - services.xserver.displayManager.sessionPackages = mkIf cfg.gamescopeSession.enable [ gamescopeSessionFile ]; + services.displayManager.sessionPackages = mkIf cfg.gamescopeSession.enable [ gamescopeSessionFile ]; # optionally enable 32bit pulseaudio support if pulseaudio is enabled hardware.pulseaudio.support32Bit = config.hardware.pulseaudio.enable; diff --git a/nixos/modules/programs/wayland/cardboard.nix b/nixos/modules/programs/wayland/cardboard.nix index 77a094a717005..0039961927378 100644 --- a/nixos/modules/programs/wayland/cardboard.nix +++ b/nixos/modules/programs/wayland/cardboard.nix @@ -17,7 +17,7 @@ in environment.systemPackages = [ cfg.package ]; # To make a cardboard session available for certain DMs like SDDM - services.xserver.displayManager.sessionPackages = [ cfg.package ]; + services.displayManager.sessionPackages = [ cfg.package ]; } (import ./wayland-session.nix { inherit lib pkgs; }) ]); diff --git a/nixos/modules/programs/wayland/hyprland.nix b/nixos/modules/programs/wayland/hyprland.nix index bb2641762cad9..b89e3fb955d4a 100644 --- a/nixos/modules/programs/wayland/hyprland.nix +++ b/nixos/modules/programs/wayland/hyprland.nix @@ -66,7 +66,7 @@ in security.polkit.enable = true; - services.xserver.displayManager.sessionPackages = [ cfg.finalPackage ]; + services.displayManager.sessionPackages = [ cfg.finalPackage ]; xdg.portal = { enable = mkDefault true; diff --git a/nixos/modules/programs/wayland/labwc.nix b/nixos/modules/programs/wayland/labwc.nix index d0806c3aa5d0e..7f5f54f031eab 100644 --- a/nixos/modules/programs/wayland/labwc.nix +++ b/nixos/modules/programs/wayland/labwc.nix @@ -18,7 +18,7 @@ in xdg.portal.config.wlroots.default = lib.mkDefault [ "wlr" "gtk" ]; # To make a labwc session available for certain DMs like SDDM - services.xserver.displayManager.sessionPackages = [ cfg.package ]; + services.displayManager.sessionPackages = [ cfg.package ]; } (import ./wayland-session.nix { inherit lib pkgs; }) ]); diff --git a/nixos/modules/programs/wayland/river.nix b/nixos/modules/programs/wayland/river.nix index 995129b9710ae..133dda539f018 100644 --- a/nixos/modules/programs/wayland/river.nix +++ b/nixos/modules/programs/wayland/river.nix @@ -47,7 +47,7 @@ in { environment.systemPackages = optional (cfg.package != null) cfg.package ++ cfg.extraPackages; # To make a river session available if a display manager like SDDM is enabled: - services.xserver.displayManager.sessionPackages = optionals (cfg.package != null) [ cfg.package ]; + services.displayManager.sessionPackages = optionals (cfg.package != null) [ cfg.package ]; # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050913 xdg.portal.config.river.default = mkDefault [ "wlr" "gtk" ]; diff --git a/nixos/modules/programs/wayland/sway.nix b/nixos/modules/programs/wayland/sway.nix index 2bd297af52544..08ae162b23b48 100644 --- a/nixos/modules/programs/wayland/sway.nix +++ b/nixos/modules/programs/wayland/sway.nix @@ -174,7 +174,7 @@ in { xdg.portal.config.sway.default = mkDefault [ "wlr" "gtk" ]; # To make a Sway session available if a display manager like SDDM is enabled: - services.xserver.displayManager.sessionPackages = optionals (cfg.package != null) [ cfg.package ]; } + services.displayManager.sessionPackages = optionals (cfg.package != null) [ cfg.package ]; } (import ./wayland-session.nix { inherit lib pkgs; }) ]); diff --git a/nixos/modules/programs/wayland/wayfire.nix b/nixos/modules/programs/wayland/wayfire.nix index 0840246e5e3ef..6f6550edc5a08 100644 --- a/nixos/modules/programs/wayland/wayfire.nix +++ b/nixos/modules/programs/wayland/wayfire.nix @@ -38,7 +38,7 @@ in finalPackage ]; - services.xserver.displayManager.sessionPackages = [ finalPackage ]; + services.displayManager.sessionPackages = [ finalPackage ]; xdg.portal = { enable = lib.mkDefault true; diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index 8e30e401c792e..01985995a651d 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -93,7 +93,7 @@ in The services.xserver.displayManager.auto module has been removed because it was only intended for use in internal NixOS tests, and gave the false impression of it being a special display manager when it's actually - LightDM. Please use the services.xserver.displayManager.autoLogin options + LightDM. Please use the services.displayManager.autoLogin options instead, or any other display manager in NixOS as they all support auto-login. '') (mkRemovedOptionModule [ "services" "xserver" "multitouch" ] '' diff --git a/nixos/modules/services/desktop-managers/plasma6.nix b/nixos/modules/services/desktop-managers/plasma6.nix index 796870aab1253..c1f3ea70cb6e9 100644 --- a/nixos/modules/services/desktop-managers/plasma6.nix +++ b/nixos/modules/services/desktop-managers/plasma6.nix @@ -246,11 +246,11 @@ in { xdg.portal.configPackages = mkDefault [kdePackages.xdg-desktop-portal-kde]; services.pipewire.enable = mkDefault true; - services.xserver.displayManager = { + services.displayManager = { sessionPackages = [kdePackages.plasma-workspace]; defaultSession = mkDefault "plasma"; }; - services.xserver.displayManager.sddm = { + services.displayManager.sddm = { package = kdePackages.sddm; theme = mkDefault "breeze"; wayland.compositor = "kwin"; diff --git a/nixos/modules/services/display-managers/default.nix b/nixos/modules/services/display-managers/default.nix index 93c4e481e5304..7f5db9fbb509b 100644 --- a/nixos/modules/services/display-managers/default.nix +++ b/nixos/modules/services/display-managers/default.nix @@ -121,7 +121,7 @@ in check = d: lib.assertMsg (d != null -> (lib.types.str.check d && lib.elem d config.services.displayManager.sessionData.sessionNames)) '' Default graphical session, '${d}', not found. - Valid names for 'services.xserver.displayManager.defaultSession' are: + Valid names for 'services.displayManager.defaultSession' are: ${lib.concatStringsSep "\n " cfg.displayManager.sessionData.sessionNames} ''; }; @@ -226,7 +226,7 @@ in systemd.services.display-manager.enable = let dmConf = config.services.xserver.displayManager; noDmUsed = !(dmConf.gdm.enable - || dmConf.sddm.enable + || cfg.sddm.enable || dmConf.xpra.enable || dmConf.lightdm.enable); in lib.mkIf noDmUsed (lib.mkDefault false); diff --git a/nixos/modules/services/display-managers/sddm.nix b/nixos/modules/services/display-managers/sddm.nix index 750b35ba72aa5..d7bd26e779d9a 100644 --- a/nixos/modules/services/display-managers/sddm.nix +++ b/nixos/modules/services/display-managers/sddm.nix @@ -2,7 +2,7 @@ let xcfg = config.services.xserver; - dmcfg = xcfg.displayManager; + dmcfg = config.services.displayManager; cfg = config.services.displayManager.sddm; xEnv = config.systemd.services.display-manager.environment; @@ -21,12 +21,12 @@ let xserverWrapper = pkgs.writeShellScript "xserver-wrapper" '' ${concatMapStrings (n: "export ${n}=\"${getAttr n xEnv}\"\n") (attrNames xEnv)} - exec systemd-cat -t xserver-wrapper ${dmcfg.xserverBin} ${toString dmcfg.xserverArgs} "$@" + exec systemd-cat -t xserver-wrapper ${xcfg.displayManager.xserverBin} ${toString xcfg.displayManager.xserverArgs} "$@" ''; Xsetup = pkgs.writeShellScript "Xsetup" '' ${cfg.setupScript} - ${dmcfg.setupCommands} + ${xcfg.displayManager.setupCommands} ''; Xstop = pkgs.writeShellScript "Xstop" '' @@ -40,7 +40,7 @@ let Numlock = if cfg.autoNumlock then "on" else "none"; # on, off none # Implementation is done via pkgs/applications/display-managers/sddm/sddm-default-session.patch - DefaultSession = optionalString (dmcfg.defaultSession != null) "${dmcfg.defaultSession}.desktop"; + DefaultSession = optionalString (config.services.displayManager.defaultSession != null) "${config.services.displayManager.defaultSession}.desktop"; DisplayServer = if cfg.wayland.enable then "wayland" else "x11"; } // optionalAttrs (cfg.wayland.compositor == "kwin") { @@ -283,13 +283,13 @@ in { assertion = xcfg.enable || cfg.wayland.enable; message = '' - SDDM requires either services.xserver.enable or services.xserver.displayManager.sddm.wayland.enable to be true + SDDM requires either services.xserver.enable or services.displayManager.sddm.wayland.enable to be true ''; } { - assertion = dmcfg.autoLogin.enable -> autoLoginSessionName != null; + assertion = config.services.displayManager.autoLogin.enable -> autoLoginSessionName != null; message = '' - SDDM auto-login requires that services.xserver.displayManager.defaultSession is set. + SDDM auto-login requires that services.displayManager.defaultSession is set. ''; } ]; diff --git a/nixos/modules/services/system/nix-daemon.nix b/nixos/modules/services/system/nix-daemon.nix index ce255cd8d0a46..550ef6b1e18c2 100644 --- a/nixos/modules/services/system/nix-daemon.nix +++ b/nixos/modules/services/system/nix-daemon.nix @@ -247,7 +247,7 @@ in users.users = nixbldUsers; - services.xserver.displayManager.hiddenUsers = attrNames nixbldUsers; + services.displayManager.hiddenUsers = attrNames nixbldUsers; # Legacy configuration conversion. nix.settings = mkMerge [ diff --git a/nixos/modules/services/x11/desktop-managers/budgie.nix b/nixos/modules/services/x11/desktop-managers/budgie.nix index 466ef5c565b7e..a911db725c014 100644 --- a/nixos/modules/services/x11/desktop-managers/budgie.nix +++ b/nixos/modules/services/x11/desktop-managers/budgie.nix @@ -91,7 +91,7 @@ in { }; config = mkIf cfg.enable { - services.xserver.displayManager.sessionPackages = with pkgs; [ + services.displayManager.sessionPackages = with pkgs; [ budgie.budgie-desktop ]; diff --git a/nixos/modules/services/x11/desktop-managers/cinnamon.nix b/nixos/modules/services/x11/desktop-managers/cinnamon.nix index f5a6c05865c47..935f173a9d81c 100644 --- a/nixos/modules/services/x11/desktop-managers/cinnamon.nix +++ b/nixos/modules/services/x11/desktop-managers/cinnamon.nix @@ -60,7 +60,7 @@ in config = mkMerge [ (mkIf cfg.enable { - services.xserver.displayManager.sessionPackages = [ pkgs.cinnamon.cinnamon-common ]; + services.displayManager.sessionPackages = [ pkgs.cinnamon.cinnamon-common ]; services.xserver.displayManager.lightdm.greeters.slick = { enable = mkDefault true; diff --git a/nixos/modules/services/x11/desktop-managers/deepin.nix b/nixos/modules/services/x11/desktop-managers/deepin.nix index 902e3a9317dd1..61f6fece58708 100644 --- a/nixos/modules/services/x11/desktop-managers/deepin.nix +++ b/nixos/modules/services/x11/desktop-managers/deepin.nix @@ -38,8 +38,8 @@ in config = mkIf cfg.enable { - services.xserver.displayManager.sessionPackages = [ pkgs.deepin.dde-session ]; - services.xserver.displayManager.defaultSession = mkDefault "dde-x11"; + services.displayManager.sessionPackages = [ pkgs.deepin.dde-session ]; + services.displayManager.defaultSession = mkDefault "dde-x11"; # Update the DBus activation environment after launching the desktop manager. services.xserver.displayManager.sessionCommands = '' diff --git a/nixos/modules/services/x11/desktop-managers/default.nix b/nixos/modules/services/x11/desktop-managers/default.nix index 33d0a7b526436..896d8dcbff40f 100644 --- a/nixos/modules/services/x11/desktop-managers/default.nix +++ b/nixos/modules/services/x11/desktop-managers/default.nix @@ -87,7 +87,7 @@ in default = null; example = "none"; description = lib.mdDoc '' - **Deprecated**, please use [](#opt-services.xserver.displayManager.defaultSession) instead. + **Deprecated**, please use [](#opt-services.displayManager.defaultSession) instead. Default desktop manager loaded if none have been chosen. ''; diff --git a/nixos/modules/services/x11/desktop-managers/enlightenment.nix b/nixos/modules/services/x11/desktop-managers/enlightenment.nix index 28dd408c923c8..d241c63436faa 100644 --- a/nixos/modules/services/x11/desktop-managers/enlightenment.nix +++ b/nixos/modules/services/x11/desktop-managers/enlightenment.nix @@ -54,7 +54,7 @@ in "/share/locale" ]; - services.xserver.displayManager.sessionPackages = [ pkgs.enlightenment.enlightenment ]; + services.displayManager.sessionPackages = [ pkgs.enlightenment.enlightenment ]; services.xserver.displayManager.sessionCommands = '' if test "$XDG_CURRENT_DESKTOP" = "Enlightenment"; then diff --git a/nixos/modules/services/x11/desktop-managers/gnome.nix b/nixos/modules/services/x11/desktop-managers/gnome.nix index 2cf9bc2eac37e..cc959bcf7bd58 100644 --- a/nixos/modules/services/x11/desktop-managers/gnome.nix +++ b/nixos/modules/services/x11/desktop-managers/gnome.nix @@ -261,7 +261,7 @@ in services.gnome.core-shell.enable = true; services.gnome.core-utilities.enable = mkDefault true; - services.xserver.displayManager.sessionPackages = [ pkgs.gnome.gnome-session.sessions ]; + services.displayManager.sessionPackages = [ pkgs.gnome.gnome-session.sessions ]; environment.extraInit = '' ${concatMapStrings (p: '' @@ -285,7 +285,7 @@ in }) (mkIf flashbackEnabled { - services.xserver.displayManager.sessionPackages = + services.displayManager.sessionPackages = let wmNames = map (wm: wm.wmName) flashbackWms; namesAreUnique = lib.unique wmNames == wmNames; diff --git a/nixos/modules/services/x11/desktop-managers/lumina.nix b/nixos/modules/services/x11/desktop-managers/lumina.nix index 7b694106bf7ee..9df9fe42a1ff6 100644 --- a/nixos/modules/services/x11/desktop-managers/lumina.nix +++ b/nixos/modules/services/x11/desktop-managers/lumina.nix @@ -27,7 +27,7 @@ in config = mkIf cfg.enable { - services.xserver.displayManager.sessionPackages = [ + services.displayManager.sessionPackages = [ pkgs.lumina.lumina ]; diff --git a/nixos/modules/services/x11/desktop-managers/mate.nix b/nixos/modules/services/x11/desktop-managers/mate.nix index 957eac7848e7f..e475442b9ef47 100644 --- a/nixos/modules/services/x11/desktop-managers/mate.nix +++ b/nixos/modules/services/x11/desktop-managers/mate.nix @@ -49,7 +49,7 @@ in config = mkMerge [ (mkIf (cfg.enable || cfg.enableWaylandSession) { - services.xserver.displayManager.sessionPackages = [ + services.displayManager.sessionPackages = [ pkgs.mate.mate-session-manager ]; @@ -103,7 +103,7 @@ in environment.sessionVariables.NIX_GSETTINGS_OVERRIDES_DIR = "${pkgs.mate.mate-gsettings-overrides}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas"; environment.systemPackages = [ pkgs.mate.mate-wayland-session ]; - services.xserver.displayManager.sessionPackages = [ pkgs.mate.mate-wayland-session ]; + services.displayManager.sessionPackages = [ pkgs.mate.mate-wayland-session ]; }) ]; } diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/x11/desktop-managers/pantheon.nix index b9ca6bd4ba8d3..695d81f666a10 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.nix +++ b/nixos/modules/services/x11/desktop-managers/pantheon.nix @@ -96,7 +96,7 @@ in pkgs.pantheon.pantheon-agent-geoclue2 ] config.environment.pantheon.excludePackages; - services.xserver.displayManager.sessionPackages = [ pkgs.pantheon.elementary-session-settings ]; + services.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 @@ -109,7 +109,7 @@ in # Without this, elementary LightDM greeter will pre-select non-existent `default` session # https://github.com/elementary/greeter/issues/368 - services.xserver.displayManager.defaultSession = mkDefault "pantheon"; + services.displayManager.defaultSession = mkDefault "pantheon"; services.xserver.displayManager.sessionCommands = '' if test "$XDG_CURRENT_DESKTOP" = "Pantheon"; then diff --git a/nixos/modules/services/x11/desktop-managers/phosh.nix b/nixos/modules/services/x11/desktop-managers/phosh.nix index 75e02130addc5..41107788db0a5 100644 --- a/nixos/modules/services/x11/desktop-managers/phosh.nix +++ b/nixos/modules/services/x11/desktop-managers/phosh.nix @@ -220,7 +220,7 @@ in services.gnome.core-shell.enable = true; services.gnome.core-os-services.enable = true; - services.xserver.displayManager.sessionPackages = [ cfg.package ]; + services.displayManager.sessionPackages = [ cfg.package ]; environment.etc."phosh/phoc.ini".source = if builtins.isPath cfg.phocConfig then cfg.phocConfig diff --git a/nixos/modules/services/x11/desktop-managers/plasma5.nix b/nixos/modules/services/x11/desktop-managers/plasma5.nix index f516a29fb5db3..bb6e5873deff9 100644 --- a/nixos/modules/services/x11/desktop-managers/plasma5.nix +++ b/nixos/modules/services/x11/desktop-managers/plasma5.nix @@ -357,7 +357,7 @@ in pkgs.media-player-info ]; - services.xserver.displayManager.sddm = { + services.displayManager.sddm = { theme = mkDefault "breeze"; }; @@ -403,16 +403,16 @@ in system.nixos-generate-config.desktopConfiguration = [ '' # Enable the Plasma 5 Desktop Environment. - services.xserver.displayManager.sddm.enable = true; + services.displayManager.sddm.enable = true; services.xserver.desktopManager.plasma5.enable = true; '' ]; - services.xserver.displayManager.sessionPackages = [ pkgs.plasma5Packages.plasma-workspace ]; + services.displayManager.sessionPackages = [ pkgs.plasma5Packages.plasma-workspace ]; # Default to be `plasma` (X11) instead of `plasmawayland`, since plasma wayland currently has # many tiny bugs. # See: https://github.com/NixOS/nixpkgs/issues/143272 - services.xserver.displayManager.defaultSession = mkDefault "plasma"; + services.displayManager.defaultSession = mkDefault "plasma"; environment.systemPackages = with pkgs.plasma5Packages; @@ -538,7 +538,7 @@ in }; }; - services.xserver.displayManager.sessionPackages = [ pkgs.plasma5Packages.plasma-mobile ]; + services.displayManager.sessionPackages = [ pkgs.plasma5Packages.plasma-mobile ]; }) # Plasma Bigscreen @@ -559,7 +559,7 @@ in kdeconnect-kde ]; - services.xserver.displayManager.sessionPackages = [ pkgs.plasma5Packages.plasma-bigscreen ]; + services.displayManager.sessionPackages = [ pkgs.plasma5Packages.plasma-bigscreen ]; # required for plasma-remotecontrollers to work correctly hardware.uinput.enable = true; diff --git a/nixos/modules/services/x11/desktop-managers/surf-display.nix b/nixos/modules/services/x11/desktop-managers/surf-display.nix index 38ebb9d02b4ac..e5f2c76f4ac25 100644 --- a/nixos/modules/services/x11/desktop-managers/surf-display.nix +++ b/nixos/modules/services/x11/desktop-managers/surf-display.nix @@ -119,7 +119,7 @@ in { }; config = mkIf cfg.enable { - services.xserver.displayManager.sessionPackages = [ + services.displayManager.sessionPackages = [ pkgs.surf-display ]; diff --git a/nixos/modules/services/x11/display-managers/default.nix b/nixos/modules/services/x11/display-managers/default.nix index 5e2d1bf39abf3..129bafefabe99 100644 --- a/nixos/modules/services/x11/display-managers/default.nix +++ b/nixos/modules/services/x11/display-managers/default.nix @@ -69,14 +69,14 @@ let source ~/.xprofile fi - ${optionalString cfg.displayManager.job.logToJournal '' + ${optionalString config.services.displayManager.logToJournal '' if [ -z "$_DID_SYSTEMD_CAT" ]; then export _DID_SYSTEMD_CAT=1 exec ${config.systemd.package}/bin/systemd-cat -t xsession "$0" "$@" fi ''} - ${optionalString cfg.displayManager.job.logToFile '' + ${optionalString config.services.displayManager.logToFile '' exec &> >(tee ~/.xsession-errors) ''} @@ -225,7 +225,7 @@ in assertions = [ { assertion = cfg.desktopManager.default != null || cfg.windowManager.default != null -> cfg.displayManager.defaultSession == defaultSessionFromLegacyOptions; - message = "You cannot use both services.xserver.displayManager.defaultSession option and legacy options (services.xserver.desktopManager.default and services.xserver.windowManager.default)."; + message = "You cannot use both services.displayManager.defaultSession option and legacy options (services.xserver.desktopManager.default and services.xserver.windowManager.default)."; } ]; diff --git a/nixos/modules/services/x11/display-managers/gdm.nix b/nixos/modules/services/x11/display-managers/gdm.nix index 400e5601dc59a..6bdfe9ea6f8cd 100644 --- a/nixos/modules/services/x11/display-managers/gdm.nix +++ b/nixos/modules/services/x11/display-managers/gdm.nix @@ -32,7 +32,7 @@ let load-module module-position-event-sounds ''; - defaultSessionName = config.services.xserver.displayManager.defaultSession; + defaultSessionName = config.services.displayManager.defaultSession; setSessionScript = pkgs.callPackage ./account-service-util.nix { }; in @@ -41,14 +41,12 @@ in imports = [ (mkRenamedOptionModule [ "services" "xserver" "displayManager" "gdm" "autoLogin" "enable" ] [ "services" - "xserver" "displayManager" "autoLogin" "enable" ]) (mkRenamedOptionModule [ "services" "xserver" "displayManager" "gdm" "autoLogin" "user" ] [ "services" - "xserver" "displayManager" "autoLogin" "user" @@ -148,14 +146,14 @@ in services.xserver.display = null; services.xserver.verbose = null; - services.xserver.displayManager.job = + services.displayManager = { environment = { GDM_X_SERVER_EXTRA_ARGS = toString (filter (arg: arg != "-terminate") cfg.xserverArgs); XDG_DATA_DIRS = lib.makeSearchPath "share" [ gdm # for gnome-login.session - cfg.sessionData.desktops + config.services.displayManager.sessionData.desktops pkgs.gnome.gnome-control-center # for accessibility icon pkgs.gnome.adwaita-icon-theme pkgs.hicolor-icon-theme # empty icon theme as a base @@ -169,7 +167,7 @@ in execCmd = "exec ${gdm}/bin/gdm"; preStart = optionalString (defaultSessionName != null) '' # Set default session in session chooser to a specified values – basically ignore session history. - ${setSessionScript}/bin/set-session ${cfg.sessionData.autologinSession} + ${setSessionScript}/bin/set-session ${config.services.displayManager.sessionData.autologinSession} ''; }; @@ -265,14 +263,14 @@ in daemon = mkMerge [ { WaylandEnable = cfg.gdm.wayland; } # nested if else didn't work - (mkIf (cfg.autoLogin.enable && cfg.gdm.autoLogin.delay != 0 ) { + (mkIf (config.services.displayManager.autoLogin.enable && cfg.gdm.autoLogin.delay != 0 ) { TimedLoginEnable = true; - TimedLogin = cfg.autoLogin.user; + TimedLogin = config.services.displayManager.autoLogin.user; TimedLoginDelay = cfg.gdm.autoLogin.delay; }) - (mkIf (cfg.autoLogin.enable && cfg.gdm.autoLogin.delay == 0 ) { + (mkIf (config.services.displayManager.autoLogin.enable && cfg.gdm.autoLogin.delay == 0 ) { AutomaticLoginEnable = true; - AutomaticLogin = cfg.autoLogin.user; + AutomaticLogin = config.services.displayManager.autoLogin.user; }) ]; debug = mkIf cfg.gdm.debug { @@ -282,7 +280,7 @@ in environment.etc."gdm/custom.conf".source = configFile; - environment.etc."gdm/Xsession".source = config.services.xserver.displayManager.sessionData.wrapper; + environment.etc."gdm/Xsession".source = config.services.displayManager.sessionData.wrapper; # GDM LFS PAM modules, adapted somehow to NixOS security.pam.services = { diff --git a/nixos/modules/services/x11/display-managers/lightdm-greeters/mini.nix b/nixos/modules/services/x11/display-managers/lightdm-greeters/mini.nix index f4195c4c2dc39..8702d0b97ed2e 100644 --- a/nixos/modules/services/x11/display-managers/lightdm-greeters/mini.nix +++ b/nixos/modules/services/x11/display-managers/lightdm-greeters/mini.nix @@ -60,7 +60,7 @@ in Note that this greeter starts only the default X session. You can configure the default X session using - [](#opt-services.xserver.displayManager.defaultSession). + [](#opt-services.displayManager.defaultSession). ''; }; diff --git a/nixos/modules/services/x11/display-managers/lightdm-greeters/tiny.nix b/nixos/modules/services/x11/display-managers/lightdm-greeters/tiny.nix index dede7680ecb3a..b2ea8e6d94f21 100644 --- a/nixos/modules/services/x11/display-managers/lightdm-greeters/tiny.nix +++ b/nixos/modules/services/x11/display-managers/lightdm-greeters/tiny.nix @@ -22,7 +22,7 @@ in Note that this greeter starts only the default X session. You can configure the default X session using - [](#opt-services.xserver.displayManager.defaultSession). + [](#opt-services.displayManager.defaultSession). ''; }; @@ -81,7 +81,7 @@ in { assertion = dmcfg.defaultSession != null; message = '' - Please set: services.xserver.displayManager.defaultSession + Please set: services.displayManager.defaultSession ''; } ]; diff --git a/nixos/modules/services/x11/display-managers/lightdm.nix b/nixos/modules/services/x11/display-managers/lightdm.nix index 548d3c5bc46a5..cb6365bace352 100644 --- a/nixos/modules/services/x11/display-managers/lightdm.nix +++ b/nixos/modules/services/x11/display-managers/lightdm.nix @@ -5,9 +5,9 @@ with lib; let xcfg = config.services.xserver; - dmcfg = xcfg.displayManager; + dmcfg = config.services.displayManager; xEnv = config.systemd.services.display-manager.environment; - cfg = dmcfg.lightdm; + cfg = xcfg.displayManager.lightdm; sessionData = dmcfg.sessionData; setSessionScript = pkgs.callPackage ./account-service-util.nix { }; @@ -26,7 +26,7 @@ let else additionalArgs="-logfile /var/log/X.$display.log" fi - exec ${dmcfg.xserverBin} ${toString dmcfg.xserverArgs} $additionalArgs "$@" + exec ${xcfg.displayManager.xserverBin} ${toString xcfg.displayManager.xserverArgs} $additionalArgs "$@" ''; usersConf = writeText "users.conf" @@ -58,10 +58,10 @@ let autologin-user-timeout = ${toString cfg.autoLogin.timeout} autologin-session = ${sessionData.autologinSession} ''} - ${optionalString (dmcfg.setupCommands != "") '' + ${optionalString (xcfg.displayManager.setupCommands != "") '' display-setup-script=${pkgs.writeScript "lightdm-display-setup" '' #!${pkgs.bash}/bin/bash - ${dmcfg.setupCommands} + ${xcfg.displayManager.setupCommands} ''} ''} ${cfg.extraSeatDefaults} @@ -86,14 +86,12 @@ in ./lightdm-greeters/mobile.nix (mkRenamedOptionModule [ "services" "xserver" "displayManager" "lightdm" "autoLogin" "enable" ] [ "services" - "xserver" "displayManager" "autoLogin" "enable" ]) (mkRenamedOptionModule [ "services" "xserver" "displayManager" "lightdm" "autoLogin" "user" ] [ "services" - "xserver" "displayManager" "autoLogin" "user" @@ -187,7 +185,7 @@ in } { assertion = dmcfg.autoLogin.enable -> sessionData.autologinSession != null; message = '' - LightDM auto-login requires that services.xserver.displayManager.defaultSession is set. + LightDM auto-login requires that services.displayManager.defaultSession is set. ''; } { assertion = !cfg.greeter.enable -> (dmcfg.autoLogin.enable && cfg.autoLogin.timeout == 0); @@ -203,12 +201,12 @@ in # Set default session in session chooser to a specified values – basically ignore session history. # Auto-login is already covered by a config value. - services.xserver.displayManager.job.preStart = optionalString (!dmcfg.autoLogin.enable && dmcfg.defaultSession != null) '' + services.displayManager.preStart = optionalString (!dmcfg.autoLogin.enable && dmcfg.defaultSession != null) '' ${setSessionScript}/bin/set-session ${dmcfg.defaultSession} ''; # setSessionScript needs session-files in XDG_DATA_DIRS - services.xserver.displayManager.job.environment.XDG_DATA_DIRS = "${dmcfg.sessionData.desktops}/share/"; + services.displayManager.environment.XDG_DATA_DIRS = "${dmcfg.sessionData.desktops}/share/"; # setSessionScript wants AccountsService systemd.services.display-manager.wants = [ @@ -216,7 +214,7 @@ in ]; # lightdm relaunches itself via just `lightdm`, so needs to be on the PATH - services.xserver.displayManager.job.execCmd = '' + services.displayManager.execCmd = '' export PATH=${lightdm}/sbin:$PATH exec ${lightdm}/sbin/lightdm ''; diff --git a/nixos/modules/services/x11/display-managers/xpra.nix b/nixos/modules/services/x11/display-managers/xpra.nix index 3e7c6b01b3e91..ce80e013e81e2 100644 --- a/nixos/modules/services/x11/display-managers/xpra.nix +++ b/nixos/modules/services/x11/display-managers/xpra.nix @@ -226,7 +226,7 @@ in VideoRam 192000 ''; - services.xserver.displayManager.job.execCmd = '' + services.displayManager.execCmd = '' ${optionalString (cfg.pulseaudio) "export PULSE_COOKIE=/run/pulse/.config/pulse/cookie"} exec ${pkgs.xpra}/bin/xpra ${if cfg.desktop == null then "start" else "start-desktop --start=${cfg.desktop}"} \ diff --git a/nixos/modules/services/x11/window-managers/default.nix b/nixos/modules/services/x11/window-managers/default.nix index e180f2693e0c6..527c95bb14ac3 100644 --- a/nixos/modules/services/x11/window-managers/default.nix +++ b/nixos/modules/services/x11/window-managers/default.nix @@ -77,7 +77,7 @@ in default = null; example = "wmii"; description = lib.mdDoc '' - **Deprecated**, please use [](#opt-services.xserver.displayManager.defaultSession) instead. + **Deprecated**, please use [](#opt-services.displayManager.defaultSession) instead. Default window manager loaded if none have been chosen. ''; diff --git a/nixos/modules/services/x11/window-managers/ragnarwm.nix b/nixos/modules/services/x11/window-managers/ragnarwm.nix index 7242c8b1324c4..0f4c2660b1e07 100644 --- a/nixos/modules/services/x11/window-managers/ragnarwm.nix +++ b/nixos/modules/services/x11/window-managers/ragnarwm.nix @@ -18,7 +18,7 @@ in ###### implementation config = mkIf cfg.enable { - services.xserver.displayManager.sessionPackages = [ cfg.package ]; + services.displayManager.sessionPackages = [ cfg.package ]; environment.systemPackages = [ cfg.package ]; }; diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index f7ca08678e708..b9d39aa2b2ef2 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -644,7 +644,7 @@ in services.xserver.displayManager.lightdm.enable = let dmConf = cfg.displayManager; default = !(dmConf.gdm.enable - || dmConf.sddm.enable + || config.services.displayManager.sddm.enable || dmConf.xpra.enable || dmConf.sx.enable || dmConf.startx.enable @@ -719,17 +719,17 @@ in environment = optionalAttrs config.hardware.opengl.setLdLibraryPath { LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.addOpenGLRunpath.driverLink ]; } - // cfg.displayManager.job.environment; + // config.services.displayManager.environment; preStart = '' - ${cfg.displayManager.job.preStart} + ${config.services.displayManager.preStart} rm -f /tmp/.X0-lock ''; # TODO: move declaring the systemd service to its own mkIf - script = mkIf (config.systemd.services.display-manager.enable == true) "${cfg.displayManager.job.execCmd}"; + script = mkIf (config.systemd.services.display-manager.enable == true) "${config.services.displayManager.execCmd}"; # Stop restarting if the display manager stops (crashes) 2 times # in one minute. Starting X typically takes 3-4s. diff --git a/nixos/modules/testing/test-instrumentation.nix b/nixos/modules/testing/test-instrumentation.nix index b07433f5c18fd..cf4a734b3f053 100644 --- a/nixos/modules/testing/test-instrumentation.nix +++ b/nixos/modules/testing/test-instrumentation.nix @@ -216,7 +216,7 @@ in # uses credentials to set passwords on users. users.users.root.hashedPasswordFile = mkOverride 150 "${pkgs.writeText "hashed-password.root" ""}"; - services.xserver.displayManager.job.logToJournal = true; + services.displayManager.logToJournal = true; # Make sure we use the Guest Agent from the QEMU package for testing # to reduce the closure size required for the tests. diff --git a/nixos/release.nix b/nixos/release.nix index ff60b0b79f6d9..2f31973569bf9 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -441,7 +441,7 @@ in rec { kde = makeClosure ({ ... }: { services.xserver.enable = true; - services.xserver.displayManager.sddm.enable = true; + services.displayManager.sddm.enable = true; services.xserver.desktopManager.plasma5.enable = true; }); diff --git a/nixos/tests/ayatana-indicators.nix b/nixos/tests/ayatana-indicators.nix index a7de640f9e37c..5709ad2a1af69 100644 --- a/nixos/tests/ayatana-indicators.nix +++ b/nixos/tests/ayatana-indicators.nix @@ -21,8 +21,8 @@ in { services.xserver = { enable = true; desktopManager.mate.enable = true; - displayManager.defaultSession = lib.mkForce "mate"; }; + services.displayManager.defaultSession = lib.mkForce "mate"; services.ayatana-indicators = { enable = true; diff --git a/nixos/tests/cinnamon-wayland.nix b/nixos/tests/cinnamon-wayland.nix index 1629ead16f41f..19529d820d9c1 100644 --- a/nixos/tests/cinnamon-wayland.nix +++ b/nixos/tests/cinnamon-wayland.nix @@ -7,7 +7,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { imports = [ ./common/user-account.nix ]; services.xserver.enable = true; services.xserver.desktopManager.cinnamon.enable = true; - services.xserver.displayManager = { + services.displayManager = { autoLogin.enable = true; autoLogin.user = nodes.machine.users.users.alice.name; defaultSession = "cinnamon-wayland"; diff --git a/nixos/tests/common/auto.nix b/nixos/tests/common/auto.nix index ac56bed4a88f1..a2e42e59c0442 100644 --- a/nixos/tests/common/auto.nix +++ b/nixos/tests/common/auto.nix @@ -30,12 +30,10 @@ in ###### implementation config = lib.mkIf cfg.enable { - services.xserver.displayManager = { - lightdm.enable = true; - autoLogin = { - enable = true; - user = cfg.user; - }; + services.xserver.displayManager.lightdm.enable = true; + services.displayManager.autoLogin = { + enable = true; + user = cfg.user; }; # lightdm by default doesn't allow auto login for root, which is diff --git a/nixos/tests/common/x11.nix b/nixos/tests/common/x11.nix index 0d76a0e972ff5..b79cedb864de4 100644 --- a/nixos/tests/common/x11.nix +++ b/nixos/tests/common/x11.nix @@ -12,6 +12,6 @@ # Use IceWM as the window manager. # Don't use a desktop manager. - services.xserver.displayManager.defaultSession = lib.mkDefault "none+icewm"; + services.displayManager.defaultSession = lib.mkDefault "none+icewm"; services.xserver.windowManager.icewm.enable = true; } diff --git a/nixos/tests/gnome-flashback.nix b/nixos/tests/gnome-flashback.nix index f486dabc5c40b..e0a1d256c8c20 100644 --- a/nixos/tests/gnome-flashback.nix +++ b/nixos/tests/gnome-flashback.nix @@ -14,16 +14,17 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : { services.xserver.displayManager = { gdm.enable = true; gdm.debug = true; - autoLogin = { - enable = true; - user = user.name; - }; + }; + + services.displayManager.autoLogin = { + enable = true; + user = user.name; }; services.xserver.desktopManager.gnome.enable = true; services.xserver.desktopManager.gnome.debug = true; services.xserver.desktopManager.gnome.flashback.enableMetacity = true; - services.xserver.displayManager.defaultSession = "gnome-flashback-metacity"; + services.displayManager.defaultSession = "gnome-flashback-metacity"; }; testScript = { nodes, ... }: let diff --git a/nixos/tests/gnome-xorg.nix b/nixos/tests/gnome-xorg.nix index 6ca700edcac38..c8ffb459edece 100644 --- a/nixos/tests/gnome-xorg.nix +++ b/nixos/tests/gnome-xorg.nix @@ -15,15 +15,16 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : { services.xserver.displayManager = { gdm.enable = true; gdm.debug = true; - autoLogin = { - enable = true; - user = user.name; - }; + }; + + services.displayManager.autoLogin = { + enable = true; + user = user.name; }; services.xserver.desktopManager.gnome.enable = true; services.xserver.desktopManager.gnome.debug = true; - services.xserver.displayManager.defaultSession = "gnome-xorg"; + services.displayManager.defaultSession = "gnome-xorg"; systemd.user.services = { "org.gnome.Shell@x11" = { diff --git a/nixos/tests/gnome.nix b/nixos/tests/gnome.nix index 91182790cb248..98d61c7ea1723 100644 --- a/nixos/tests/gnome.nix +++ b/nixos/tests/gnome.nix @@ -12,10 +12,11 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : { services.xserver.displayManager = { gdm.enable = true; gdm.debug = true; - autoLogin = { - enable = true; - user = "alice"; - }; + }; + + services.displayManager.autoLogin = { + enable = true; + user = "alice"; }; services.xserver.desktopManager.gnome.enable = true; diff --git a/nixos/tests/herbstluftwm.nix b/nixos/tests/herbstluftwm.nix index b6965914360e7..2a8b391947e74 100644 --- a/nixos/tests/herbstluftwm.nix +++ b/nixos/tests/herbstluftwm.nix @@ -8,7 +8,7 @@ import ./make-test-python.nix ({ lib, ...} : { nodes.machine = { pkgs, lib, ... }: { imports = [ ./common/x11.nix ./common/user-account.nix ]; test-support.displayManager.auto.user = "alice"; - services.xserver.displayManager.defaultSession = lib.mkForce "none+herbstluftwm"; + services.displayManager.defaultSession = lib.mkForce "none+herbstluftwm"; services.xserver.windowManager.herbstluftwm.enable = true; environment.systemPackages = [ pkgs.dzen2 ]; # needed for upstream provided panel }; diff --git a/nixos/tests/i3wm.nix b/nixos/tests/i3wm.nix index b216650d8192b..c02ce86db8b20 100644 --- a/nixos/tests/i3wm.nix +++ b/nixos/tests/i3wm.nix @@ -7,7 +7,7 @@ import ./make-test-python.nix ({ pkgs, ...} : { nodes.machine = { lib, ... }: { imports = [ ./common/x11.nix ./common/user-account.nix ]; test-support.displayManager.auto.user = "alice"; - services.xserver.displayManager.defaultSession = lib.mkForce "none+i3"; + services.displayManager.defaultSession = lib.mkForce "none+i3"; services.xserver.windowManager.i3.enable = true; }; diff --git a/nixos/tests/lightdm.nix b/nixos/tests/lightdm.nix index 94cebd4a630ab..730983a804134 100644 --- a/nixos/tests/lightdm.nix +++ b/nixos/tests/lightdm.nix @@ -8,7 +8,7 @@ import ./make-test-python.nix ({ pkgs, ...} : { imports = [ ./common/user-account.nix ]; services.xserver.enable = true; services.xserver.displayManager.lightdm.enable = true; - services.xserver.displayManager.defaultSession = "none+icewm"; + services.displayManager.defaultSession = "none+icewm"; services.xserver.windowManager.icewm.enable = true; }; diff --git a/nixos/tests/maestral.nix b/nixos/tests/maestral.nix index 67a265926187d..52cc32cd0f4bb 100644 --- a/nixos/tests/maestral.nix +++ b/nixos/tests/maestral.nix @@ -29,11 +29,14 @@ import ./make-test-python.nix ({ pkgs, ... }: { gui = { ... }: common { services.xserver = { enable = true; - displayManager.sddm.enable = true; - displayManager.defaultSession = "plasma"; desktopManager.plasma5.enable = true; desktopManager.plasma5.runUsingSystemd = true; - displayManager.autoLogin = { + }; + + services.displayManager = { + sddm.enable = true; + defaultSession = "plasma"; + autoLogin = { enable = true; user = "alice"; }; diff --git a/nixos/tests/mate-wayland.nix b/nixos/tests/mate-wayland.nix index df39ead286e15..e5c96d2af7470 100644 --- a/nixos/tests/mate-wayland.nix +++ b/nixos/tests/mate-wayland.nix @@ -9,7 +9,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { ]; services.xserver.enable = true; - services.xserver.displayManager = { + services.displayManager = { sddm.enable = true; # https://github.com/canonical/lightdm/issues/63 sddm.wayland.enable = true; defaultSession = "MATE"; diff --git a/nixos/tests/miriway.nix b/nixos/tests/miriway.nix index 24e6ec6367cdb..94373bb75a915 100644 --- a/nixos/tests/miriway.nix +++ b/nixos/tests/miriway.nix @@ -19,10 +19,8 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { user = "alice"; }; - services.xserver = { - enable = true; - displayManager.defaultSession = lib.mkForce "miriway"; - }; + services.xserver.enable = true; + services.displayManager.defaultSession = lib.mkForce "miriway"; programs.miriway = { enable = true; diff --git a/nixos/tests/nimdow.nix b/nixos/tests/nimdow.nix index cefe46edc5fb2..0656ef04be483 100644 --- a/nixos/tests/nimdow.nix +++ b/nixos/tests/nimdow.nix @@ -7,7 +7,7 @@ import ./make-test-python.nix ({ pkgs, ...} : { nodes.machine = { lib, ... }: { imports = [ ./common/x11.nix ./common/user-account.nix ]; test-support.displayManager.auto.user = "alice"; - services.xserver.displayManager.defaultSession = lib.mkForce "none+nimdow"; + services.displayManager.defaultSession = lib.mkForce "none+nimdow"; services.xserver.windowManager.nimdow.enable = true; }; diff --git a/nixos/tests/plasma-bigscreen.nix b/nixos/tests/plasma-bigscreen.nix index 2fe90fa9b539c..050937f33442d 100644 --- a/nixos/tests/plasma-bigscreen.nix +++ b/nixos/tests/plasma-bigscreen.nix @@ -11,10 +11,10 @@ import ./make-test-python.nix ({ pkgs, ...} : { imports = [ ./common/user-account.nix ]; services.xserver.enable = true; - services.xserver.displayManager.sddm.enable = true; - services.xserver.displayManager.defaultSession = "plasma-bigscreen-x11"; + services.displayManager.sddm.enable = true; + services.displayManager.defaultSession = "plasma-bigscreen-x11"; services.xserver.desktopManager.plasma5.bigscreen.enable = true; - services.xserver.displayManager.autoLogin = { + services.displayManager.autoLogin = { enable = true; user = "alice"; }; diff --git a/nixos/tests/plasma5-systemd-start.nix b/nixos/tests/plasma5-systemd-start.nix index 31a313af308b4..891d4df2409f2 100644 --- a/nixos/tests/plasma5-systemd-start.nix +++ b/nixos/tests/plasma5-systemd-start.nix @@ -12,11 +12,14 @@ import ./make-test-python.nix ({ pkgs, ...} : imports = [ ./common/user-account.nix ]; services.xserver = { enable = true; - displayManager.sddm.enable = true; - displayManager.defaultSession = "plasma"; desktopManager.plasma5.enable = true; desktopManager.plasma5.runUsingSystemd = true; - displayManager.autoLogin = { + }; + + services.displayManager = { + sddm.enable = true; + defaultSession = "plasma"; + autoLogin = { enable = true; user = "alice"; }; diff --git a/nixos/tests/plasma5.nix b/nixos/tests/plasma5.nix index fb8a5b73832ea..1bff37981da3f 100644 --- a/nixos/tests/plasma5.nix +++ b/nixos/tests/plasma5.nix @@ -11,11 +11,11 @@ import ./make-test-python.nix ({ pkgs, ...} : { imports = [ ./common/user-account.nix ]; services.xserver.enable = true; - services.xserver.displayManager.sddm.enable = true; - services.xserver.displayManager.defaultSession = "plasma"; + services.displayManager.sddm.enable = true; + services.displayManager.defaultSession = "plasma"; services.xserver.desktopManager.plasma5.enable = true; environment.plasma5.excludePackages = [ pkgs.plasma5Packages.elisa ]; - services.xserver.displayManager.autoLogin = { + services.displayManager.autoLogin = { enable = true; user = "alice"; }; diff --git a/nixos/tests/plasma6.nix b/nixos/tests/plasma6.nix index ec5b3f24ef749..7c8fba130e681 100644 --- a/nixos/tests/plasma6.nix +++ b/nixos/tests/plasma6.nix @@ -11,12 +11,12 @@ import ./make-test-python.nix ({ pkgs, ...} : { imports = [ ./common/user-account.nix ]; services.xserver.enable = true; - services.xserver.displayManager.sddm.enable = true; + services.displayManager.sddm.enable = true; # FIXME: this should be testing Wayland - services.xserver.displayManager.defaultSession = "plasmax11"; - services.xserver.desktopManager.plasma6.enable = true; + services.displayManager.defaultSession = "plasmax11"; + services.desktopManager.plasma6.enable = true; environment.plasma6.excludePackages = [ pkgs.kdePackages.elisa ]; - services.xserver.displayManager.autoLogin = { + services.displayManager.autoLogin = { enable = true; user = "alice"; }; diff --git a/nixos/tests/ragnarwm.nix b/nixos/tests/ragnarwm.nix index f7c588b920081..6dc08a805ab12 100644 --- a/nixos/tests/ragnarwm.nix +++ b/nixos/tests/ragnarwm.nix @@ -8,7 +8,7 @@ import ./make-test-python.nix ({ lib, ...} : { nodes.machine = { pkgs, lib, ... }: { imports = [ ./common/x11.nix ./common/user-account.nix ]; test-support.displayManager.auto.user = "alice"; - services.xserver.displayManager.defaultSession = lib.mkForce "ragnar"; + services.displayManager.defaultSession = lib.mkForce "ragnar"; services.xserver.windowManager.ragnarwm.enable = true; # Setup the default terminal of Ragnar diff --git a/nixos/tests/sddm.nix b/nixos/tests/sddm.nix index b6c05deac05e4..3ca105cf9713d 100644 --- a/nixos/tests/sddm.nix +++ b/nixos/tests/sddm.nix @@ -15,8 +15,8 @@ let nodes.machine = { ... }: { imports = [ ./common/user-account.nix ]; services.xserver.enable = true; - services.xserver.displayManager.sddm.enable = true; - services.xserver.displayManager.defaultSession = "none+icewm"; + services.displayManager.sddm.enable = true; + services.displayManager.defaultSession = "none+icewm"; services.xserver.windowManager.icewm.enable = true; }; @@ -44,14 +44,14 @@ let nodes.machine = { ... }: { imports = [ ./common/user-account.nix ]; services.xserver.enable = true; - services.xserver.displayManager = { + services.displayManager = { sddm.enable = true; autoLogin = { enable = true; user = "alice"; }; }; - services.xserver.displayManager.defaultSession = "none+icewm"; + services.displayManager.defaultSession = "none+icewm"; services.xserver.windowManager.icewm.enable = true; }; diff --git a/nixos/tests/wmderland.nix b/nixos/tests/wmderland.nix index ebfd443763e1e..c60751c44e2cc 100644 --- a/nixos/tests/wmderland.nix +++ b/nixos/tests/wmderland.nix @@ -7,7 +7,7 @@ import ./make-test-python.nix ({ pkgs, ...} : { nodes.machine = { lib, ... }: { imports = [ ./common/x11.nix ./common/user-account.nix ]; test-support.displayManager.auto.user = "alice"; - services.xserver.displayManager.defaultSession = lib.mkForce "none+wmderland"; + services.displayManager.defaultSession = lib.mkForce "none+wmderland"; services.xserver.windowManager.wmderland.enable = true; systemd.services.setupWmderlandConfig = { diff --git a/nixos/tests/xfce.nix b/nixos/tests/xfce.nix index 9620e9188cbf5..d97f07d752712 100644 --- a/nixos/tests/xfce.nix +++ b/nixos/tests/xfce.nix @@ -10,13 +10,11 @@ import ./make-test-python.nix ({ pkgs, ...} : { ]; services.xserver.enable = true; + services.xserver.displayManager.lightdm.enable = true; - services.xserver.displayManager = { - lightdm.enable = true; - autoLogin = { - enable = true; - user = "alice"; - }; + services.displayManager.autoLogin = { + enable = true; + user = "alice"; }; services.xserver.desktopManager.xfce.enable = true; diff --git a/nixos/tests/xmonad-xdg-autostart.nix b/nixos/tests/xmonad-xdg-autostart.nix index 2577a9ce2ea13..f1780072f9740 100644 --- a/nixos/tests/xmonad-xdg-autostart.nix +++ b/nixos/tests/xmonad-xdg-autostart.nix @@ -5,7 +5,7 @@ import ./make-test-python.nix ({ lib, ... }: { nodes.machine = { pkgs, config, ... }: { imports = [ ./common/x11.nix ./common/user-account.nix ]; test-support.displayManager.auto.user = "alice"; - services.xserver.displayManager.defaultSession = "none+xmonad"; + services.displayManager.defaultSession = "none+xmonad"; services.xserver.windowManager.xmonad.enable = true; services.xserver.desktopManager.runXdgAutostartIfNone = true; diff --git a/nixos/tests/xmonad.nix b/nixos/tests/xmonad.nix index ec48c3e112750..c61e96886e2c5 100644 --- a/nixos/tests/xmonad.nix +++ b/nixos/tests/xmonad.nix @@ -61,7 +61,7 @@ in { nodes.machine = { pkgs, ... }: { imports = [ ./common/x11.nix ./common/user-account.nix ]; test-support.displayManager.auto.user = "alice"; - services.xserver.displayManager.defaultSession = "none+xmonad"; + services.displayManager.defaultSession = "none+xmonad"; services.xserver.windowManager.xmonad = { enable = true; enableConfiguredRecompile = true;