From fc035da4a4a39d860e0edea0c95c6ca2de79e889 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 20 Aug 2018 14:25:25 +0200 Subject: [PATCH] xserver.displayManager: change default Switch from slim to lightdm as the display-manager. If plasma5 is used as desktop-manager use sdddm. If gnome3 is used as desktop-manager use gdm. Based on #12516 --- nixos/doc/manual/release-notes/rl-1809.xml | 7 +++++++ nixos/modules/services/x11/desktop-managers/gnome3.nix | 3 +++ nixos/modules/services/x11/display-managers/auto.nix | 8 +++++--- nixos/modules/services/x11/display-managers/gdm.nix | 2 +- nixos/modules/services/x11/display-managers/lightdm.nix | 2 -- nixos/modules/services/x11/display-managers/sddm.nix | 2 -- nixos/modules/services/x11/display-managers/slim.nix | 2 +- nixos/modules/services/x11/xserver.nix | 9 +++++++++ nixos/tests/gnome3-gdm.nix | 1 - nixos/tests/gnome3.nix | 1 + 10 files changed, 27 insertions(+), 10 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-1809.xml b/nixos/doc/manual/release-notes/rl-1809.xml index 6da67fe6d1eb..421208ec0f8c 100644 --- a/nixos/doc/manual/release-notes/rl-1809.xml +++ b/nixos/doc/manual/release-notes/rl-1809.xml @@ -521,6 +521,13 @@ inherit (pkgs.nixos { all user units for each authenticated user. + + + The default display manager is now LightDM. + To use SLiM set services.xserver.displayManager.slim.enable + to true. + + diff --git a/nixos/modules/services/x11/desktop-managers/gnome3.nix b/nixos/modules/services/x11/desktop-managers/gnome3.nix index c339d24b098a..86b49a001ce1 100644 --- a/nixos/modules/services/x11/desktop-managers/gnome3.nix +++ b/nixos/modules/services/x11/desktop-managers/gnome3.nix @@ -132,6 +132,7 @@ in { fonts.fonts = [ pkgs.dejavu_fonts pkgs.cantarell-fonts ]; + services.xserver.displayManager.gdm.enable = mkDefault true; services.xserver.displayManager.extraSessionFilePackages = [ pkgs.gnome3.gnome-session ]; services.xserver.displayManager.sessionCommands = '' @@ -161,6 +162,8 @@ in { # TODO: Create nautilus-with-extensions package environment.variables.NAUTILUS_EXTENSION_DIR = "${config.system.path}/lib/nautilus/extensions-3.0"; + services.xserver.updateDbusEnvironment = true; + environment.variables.GIO_EXTRA_MODULES = [ "${lib.getLib pkgs.gnome3.dconf}/lib/gio/modules" "${pkgs.gnome3.glib-networking.out}/lib/gio/modules" "${pkgs.gnome3.gvfs}/lib/gio/modules" ]; diff --git a/nixos/modules/services/x11/display-managers/auto.nix b/nixos/modules/services/x11/display-managers/auto.nix index d2aae64bf225..ec419eea0677 100644 --- a/nixos/modules/services/x11/display-managers/auto.nix +++ b/nixos/modules/services/x11/display-managers/auto.nix @@ -41,10 +41,12 @@ in config = mkIf cfg.enable { - services.xserver.displayManager.slim = { + services.xserver.displayManager.lightdm = { enable = true; - autoLogin = true; - defaultUser = cfg.user; + autoLogin = { + enable = true; + user = cfg.user; + }; }; }; diff --git a/nixos/modules/services/x11/display-managers/gdm.nix b/nixos/modules/services/x11/display-managers/gdm.nix index 78dc39f7f62f..a775dd0f0e04 100644 --- a/nixos/modules/services/x11/display-managers/gdm.nix +++ b/nixos/modules/services/x11/display-managers/gdm.nix @@ -87,7 +87,7 @@ in } ]; - services.xserver.displayManager.slim.enable = false; + services.xserver.displayManager.lightdm.enable = false; users.users.gdm = { name = "gdm"; diff --git a/nixos/modules/services/x11/display-managers/lightdm.nix b/nixos/modules/services/x11/display-managers/lightdm.nix index dc82f7086c82..bd4829228e1f 100644 --- a/nixos/modules/services/x11/display-managers/lightdm.nix +++ b/nixos/modules/services/x11/display-managers/lightdm.nix @@ -191,8 +191,6 @@ in } ]; - services.xserver.displayManager.slim.enable = false; - services.xserver.displayManager.job = { logToFile = true; diff --git a/nixos/modules/services/x11/display-managers/sddm.nix b/nixos/modules/services/x11/display-managers/sddm.nix index 2b03ed81b5ed..1635c0f9acc5 100644 --- a/nixos/modules/services/x11/display-managers/sddm.nix +++ b/nixos/modules/services/x11/display-managers/sddm.nix @@ -206,8 +206,6 @@ in } ]; - services.xserver.displayManager.slim.enable = false; - services.xserver.displayManager.job = { logToFile = true; diff --git a/nixos/modules/services/x11/display-managers/slim.nix b/nixos/modules/services/x11/display-managers/slim.nix index 51ce5f4e2437..4e411c8ceb0b 100644 --- a/nixos/modules/services/x11/display-managers/slim.nix +++ b/nixos/modules/services/x11/display-managers/slim.nix @@ -49,7 +49,7 @@ in enable = mkOption { type = types.bool; - default = config.services.xserver.enable; + default = false; description = '' Whether to enable SLiM as the display manager. ''; diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index 0237dd6f5604..75bfeaac1fa3 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -535,6 +535,15 @@ in config = mkIf cfg.enable { + services.xserver.displayManager.lightdm.enable = + let dmconf = cfg.displayManager; + default = !( dmconf.auto.enable + || dmconf.gdm.enable + || dmconf.sddm.enable + || dmconf.slim.enable + || dmconf.xpra.enable ); + in mkIf (default) true; + hardware.opengl.enable = mkDefault true; services.xserver.videoDrivers = mkIf (cfg.videoDriver != null) [ cfg.videoDriver ]; diff --git a/nixos/tests/gnome3-gdm.nix b/nixos/tests/gnome3-gdm.nix index 1f590f337fd9..959030d59880 100644 --- a/nixos/tests/gnome3-gdm.nix +++ b/nixos/tests/gnome3-gdm.nix @@ -11,7 +11,6 @@ import ./make-test.nix ({ pkgs, ...} : { services.xserver.enable = true; - services.xserver.displayManager.slim.enable = false; services.xserver.displayManager.gdm = { enable = true; autoLogin = { diff --git a/nixos/tests/gnome3.nix b/nixos/tests/gnome3.nix index af2404bf530c..3f0368592b8d 100644 --- a/nixos/tests/gnome3.nix +++ b/nixos/tests/gnome3.nix @@ -11,6 +11,7 @@ import ./make-test.nix ({ pkgs, ...} : { services.xserver.enable = true; + services.xserver.displayManager.gdm.enable = false; services.xserver.displayManager.lightdm.enable = true; services.xserver.displayManager.lightdm.autoLogin.enable = true; services.xserver.displayManager.lightdm.autoLogin.user = "alice";