Skip to content

Commit

Permalink
Merge pull request #76985 from Elyhaka/gdm_hides_gnome
Browse files Browse the repository at this point in the history
gdm: refactor to properly handle wayland sessions
  • Loading branch information
worldofpeace committed Jan 19, 2020
2 parents 5f594c6 + c6022f7 commit 765afd3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
12 changes: 9 additions & 3 deletions nixos/modules/services/x11/desktop-managers/gnome3.nix
Expand Up @@ -144,7 +144,7 @@ in
services.gnome3.core-shell.enable = true;
services.gnome3.core-utilities.enable = mkDefault true;

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

environment.extraInit = ''
${concatMapStrings (p: ''
Expand Down Expand Up @@ -249,11 +249,17 @@ in
services.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true));
services.telepathy.enable = mkDefault true;

systemd.packages = with pkgs.gnome3; [ vino gnome-session ];
systemd.packages = with pkgs.gnome3; [
gnome-session
gnome-shell
vino
];

services.avahi.enable = mkDefault true;

xdg.portal.extraPortals = [ pkgs.gnome3.gnome-shell ];
xdg.portal.extraPortals = [
pkgs.gnome3.gnome-shell
];

services.geoclue2.enable = mkDefault true;
services.geoclue2.enableDemoAgent = false; # GNOME has its own geoclue agent
Expand Down
4 changes: 4 additions & 0 deletions nixos/modules/services/x11/display-managers/gdm.nix
Expand Up @@ -174,6 +174,10 @@ in
"f /run/gdm/.config/gnome-initial-setup-done 0711 gdm gdm - yes"
];

# Otherwise GDM will not be able to start correctly and display Wayland sessions
systemd.packages = with pkgs.gnome3; [ gnome-session gnome-shell ];
environment.systemPackages = [ pkgs.gnome3.adwaita-icon-theme ];

systemd.services.display-manager.wants = [
# Because sd_login_monitor_new requires /run/systemd/machines
"systemd-machined.service"
Expand Down
11 changes: 11 additions & 0 deletions pkgs/desktops/gnome-3/core/gnome-session/default.nix
Expand Up @@ -6,6 +6,8 @@ stdenv.mkDerivation rec {
pname = "gnome-session";
version = "3.34.2";

outputs = ["out" "sessions"];

src = fetchurl {
url = "mirror://gnome/sources/gnome-session/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "1qgqp97f8k2zi2ydvhds14zsjzfj7cv521r6wx5sw0qacn0p7dwb";
Expand Down Expand Up @@ -50,6 +52,15 @@ stdenv.mkDerivation rec {
--suffix XDG_CONFIG_DIRS : "${gnome3.gnome-settings-daemon}/etc/xdg"
'';

# We move the GNOME sessions to another output since gnome-session is a dependency of
# GDM itself. If we do not hide them, it will show broken GNOME sessions when GDM is
# enabled without proper GNOME installation.
postInstall = ''
mkdir $sessions
moveToOutput share/wayland-sessions "$sessions"
moveToOutput share/xsessions "$sessions"
'';

passthru = {
updateScript = gnome3.updateScript {
packageName = "gnome-session";
Expand Down

0 comments on commit 765afd3

Please sign in to comment.