From bd3f680d370e43986224bf2b83047238f2bbd039 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Fri, 5 Apr 2024 21:23:11 +0800 Subject: [PATCH] pantheon.gala: Backport Wayland menu commit gala-daemon actually needs a correct environment for `AppInfo.launch_default_for_uri`. --- .../services/x11/desktop-managers/pantheon.nix | 16 ---------------- nixos/tests/pantheon.nix | 2 +- pkgs/desktops/pantheon/desktop/gala/default.nix | 11 ++++++++--- 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/x11/desktop-managers/pantheon.nix index 2cfdc69b86e0..b9ca6bd4ba8d 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.nix +++ b/nixos/modules/services/x11/desktop-managers/pantheon.nix @@ -190,22 +190,6 @@ in "org.gnome.SettingsDaemon.XSettings.service" ]; - # https://github.com/elementary/gala/issues/1826#issuecomment-1890461298 - systemd.user.services."io.elementary.gala.daemon@" = { - unitConfig = { - Description = "Gala Daemon"; - BindsTo = "io.elementary.gala@.service"; - After = "io.elementary.gala@.service"; - }; - - serviceConfig = { - Type = "dbus"; - BusName = "org.pantheon.gala.daemon"; - ExecStart = "${pkgs.pantheon.gala}/bin/gala-daemon"; - Slice = "session.slice"; - }; - }; - # Global environment environment.systemPackages = (with pkgs.pantheon; [ elementary-session-settings diff --git a/nixos/tests/pantheon.nix b/nixos/tests/pantheon.nix index 14f92fa3af4a..f8de2eb8061d 100644 --- a/nixos/tests/pantheon.nix +++ b/nixos/tests/pantheon.nix @@ -50,7 +50,7 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : machine.wait_until_succeeds(f"pgrep -f {i}") for i in ["gala", "io.elementary.wingpanel", "plank"]: machine.wait_for_window(i) - for i in ["io.elementary.gala.daemon@x11.service", "bamfdaemon.service", "io.elementary.files.xdg-desktop-portal.service"]: + for i in ["bamfdaemon.service", "io.elementary.files.xdg-desktop-portal.service"]: machine.wait_for_unit(i, "${user.name}") with subtest("Check if various environment variables are set"): diff --git a/pkgs/desktops/pantheon/desktop/gala/default.nix b/pkgs/desktops/pantheon/desktop/gala/default.nix index 123870c356de..3cf8a67e9539 100644 --- a/pkgs/desktops/pantheon/desktop/gala/default.nix +++ b/pkgs/desktops/pantheon/desktop/gala/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchFromGitHub +, fetchpatch , nix-update-script , pkg-config , meson @@ -39,6 +40,13 @@ stdenv.mkDerivation rec { # We look for plugins in `/run/current-system/sw/lib/` because # there are multiple plugin providers (e.g. gala and wingpanel). ./plugins-dir.patch + + # Start gala-daemon internally (needed for systemd managed gnome-session) + # https://github.com/elementary/gala/pull/1844 + (fetchpatch { + url = "https://github.com/elementary/gala/commit/351722c5a4fded46992b725e03dc94971c5bd31f.patch"; + hash = "sha256-RvdVHQjCUNmLrROBZTF+m1vE2XudtQZjk/YW28P/vKc="; + }) ]; nativeBuildInputs = [ @@ -70,9 +78,6 @@ stdenv.mkDerivation rec { postPatch = '' chmod +x build-aux/meson/post_install.py patchShebangs build-aux/meson/post_install.py - - # https://github.com/elementary/gala/issues/1826#issuecomment-1890461298 - sed '2i Wants=io.elementary.gala.daemon@.service' -i 'data/gala@x11.service.in' ''; passthru = {