Unverified Commit 3cdbf0a9 authored by Bobby Rong's avatar Bobby Rong Committed by GitHub
Browse files

Pantheon 8 (#312449)

parents 48173f9b cc6f2096
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -325,6 +325,10 @@
  - Following [changes in Mint 22](https://github.com/linuxmint/mintupgrade/commit/f239cde908288b8c250f938e7311c7ffbc16bd59) we are no longer overriding Qt application styles. You can still restore the previous default with `qt.style = "gtk2"` and `qt.platformTheme = "gtk2"`.
  - Following [changes in Mint 20](https://github.com/linuxmint/mintupgrade-legacy/commit/ce15d946ed9a8cb8444abd25088edd824bfb18f6) we are replacing xplayer with celluloid since xplayer is no longer maintained.

- Pantheon has been updated to 8, please check the [upstream announcement](https://blog.elementary.io/os-8-available-now/) for more details.
  - Same as elementary OS, the X11 session is named "Classic Session" and the Wayland session is named "Secure Session".
  - The dock has been rewritten, you need to manually migrate the dock items on update. You can check `~/.config/plank/dock1/launchers/` for your previous settings.

- Xfce has been updated to 4.20, please check the [upstream feature tour](https://www.xfce.org/about/tour420) for more details.
  - Wayland session is still [experimental](https://wiki.xfce.org/releng/wayland_roadmap) and requires opt-in using `enableWaylandSession` option.
  - Overriding Wayland compositor is possible using `enableWaylandSession` option, but you might need to take care [`xfce4-session`](https://gitlab.xfce.org/xfce/xfce4-session/-/merge_requests/49), [`dbus-update-activation-environment`](https://github.com/labwc/labwc/blob/eaf11face68ee1f1bcc7ce1498304ca8c108c8ba/src/config/session.c#L234) and [`systemctl --user import-environment`](https://github.com/labwc/labwc/blob/eaf11face68ee1f1bcc7ce1498304ca8c108c8ba/src/config/session.c#L239) on startup.
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
{ config, lib, pkgs, ... }:
{
  meta = with lib; {
    maintainers = with lib.maintainers; [ ] ++ lib.teams.pantheon.members;
    maintainers = with lib.maintainers; [ ];
  };

  ###### interface
+13 −16
Original line number Diff line number Diff line
@@ -112,9 +112,7 @@ in
      # https://github.com/elementary/greeter/issues/368
      services.displayManager.defaultSession = mkDefault "pantheon";

      services.xserver.displayManager.sessionCommands = ''
        if test "$XDG_CURRENT_DESKTOP" = "Pantheon"; then
            true
      environment.extraInit = ''
        ${concatMapStrings (p: ''
          if [ -d "${p}/share/gsettings-schemas/${p.name}" ]; then
            export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share/gsettings-schemas/${p.name}
@@ -125,14 +123,12 @@ in
            export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${p}/lib
          fi
        '') cfg.sessionPath}
        fi
      '';

      # Default services
      hardware.bluetooth.enable = mkDefault true;
      security.polkit.enable = true;
      services.accounts-daemon.enable = true;
      services.bamf.enable = true;
      services.colord.enable = mkDefault true;
      services.fwupd.enable = mkDefault true;
      # TODO: Enable once #177946 is resolved
@@ -232,7 +228,8 @@ in
      ])) config.environment.pantheon.excludePackages;

      # Settings from elementary-default-settings
      environment.etc."gtk-3.0/settings.ini".source = "${pkgs.pantheon.elementary-default-settings}/etc/gtk-3.0/settings.ini";
      # GTK4 will try both $XDG_CONFIG_DIRS/gtk-4.0 and ${gtk4}/etc/gtk-4.0, but not /etc/gtk-4.0.
      environment.etc."xdg/gtk-4.0/settings.ini".source = "${pkgs.pantheon.elementary-default-settings}/etc/gtk-4.0/settings.ini";

      xdg.mime.enable = true;
      xdg.icons.enable = true;
+1 −0
Original line number Diff line number Diff line
@@ -798,6 +798,7 @@ in {
  patroni = handleTestOn ["x86_64-linux"] ./patroni.nix {};
  pantalaimon = handleTest ./matrix/pantalaimon.nix {};
  pantheon = handleTest ./pantheon.nix {};
  pantheon-wayland = handleTest ./pantheon-wayland.nix {};
  paperless = handleTest ./paperless.nix {};
  parsedmarc = handleTest ./parsedmarc {};
  password-option-override-ordering = handleTest ./password-option-override-ordering.nix {};
+105 −0
Original line number Diff line number Diff line
import ./make-test-python.nix (
  { pkgs, lib, ... }:

  {
    name = "pantheon-wayland";

    meta.maintainers = lib.teams.pantheon.members;

    nodes.machine =
      { nodes, ... }:

      let
        videosAutostart = pkgs.writeTextFile {
          name = "autostart-elementary-videos";
          destination = "/etc/xdg/autostart/io.elementary.videos.desktop";
          text = ''
            [Desktop Entry]
            Version=1.0
            Name=Videos
            Type=Application
            Terminal=false
            Exec=io.elementary.videos %U
          '';
        };
      in
      {
        imports = [ ./common/user-account.nix ];

        # Workaround ".gala-wrapped invoked oom-killer"
        virtualisation.memorySize = 2047;

        services.xserver.enable = true;
        services.xserver.desktopManager.pantheon.enable = true;
        services.displayManager = {
          autoLogin.enable = true;
          autoLogin.user = nodes.machine.users.users.alice.name;
          defaultSession = "pantheon-wayland";
        };

        # We ship pantheon.appcenter by default when this is enabled.
        services.flatpak.enable = true;

        # For basic OCR tests.
        environment.systemPackages = [ videosAutostart ];

        # We don't ship gnome-text-editor in Pantheon module, we add this line mainly
        # to catch eval issues related to this option.
        environment.pantheon.excludePackages = [ pkgs.gnome-text-editor ];
      };

    enableOCR = true;

    testScript =
      { nodes, ... }:
      let
        user = nodes.machine.users.users.alice;
      in
      ''
        machine.wait_for_unit("display-manager.service")

        with subtest("Wait for wayland server"):
            machine.wait_for_file("/run/user/${toString user.uid}/wayland-0")

        with subtest("Check that logging in has given the user ownership of devices"):
            machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")

        with subtest("Check if Pantheon components actually start"):
            # We specifically check gsd-xsettings here since it is manually pulled up by gala.
            # https://github.com/elementary/gala/pull/2140
            for i in ["gala", "io.elementary.wingpanel", "io.elementary.dock", "gsd-media-keys", "gsd-xsettings", "io.elementary.desktop.agent-polkit"]:
                machine.wait_until_succeeds(f"pgrep -f {i}")
            for i in ["io.elementary.files.xdg-desktop-portal.service"]:
                machine.wait_for_unit(i, "${user.name}")

        with subtest("Check if various environment variables are set"):
            cmd = "xargs --null --max-args=1 echo < /proc/$(pgrep -xf ${pkgs.pantheon.gala}/bin/gala)/environ"
            machine.succeed(f"{cmd} | grep 'XDG_CURRENT_DESKTOP' | grep 'Pantheon'")
            machine.succeed(f"{cmd} | grep 'XDG_SESSION_TYPE' | grep 'wayland'")
            # Hopefully from the sessionPath option.
            machine.succeed(f"{cmd} | grep 'XDG_DATA_DIRS' | grep 'gsettings-schemas/pantheon-agent-geoclue2'")
            # Hopefully from login shell.
            machine.succeed(f"{cmd} | grep '__NIXOS_SET_ENVIRONMENT_DONE' | grep '1'")

        with subtest("Wait for elementary videos autostart"):
            machine.wait_until_succeeds("pgrep -f io.elementary.videos")
            machine.wait_for_text("No Videos Open")
            machine.screenshot("videos")

        with subtest("Trigger multitasking view"):
            cmd = "dbus-send --session --dest=org.pantheon.gala --print-reply /org/pantheon/gala org.pantheon.gala.PerformAction int32:1"
            env = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${toString user.uid}/bus"
            machine.succeed(f"su - ${user.name} -c '{env} {cmd}'")
            machine.sleep(5)
            machine.screenshot("multitasking")
            machine.succeed(f"su - ${user.name} -c '{env} {cmd}'")

        with subtest("Check if gala has ever coredumped"):
            machine.fail("coredumpctl --json=short | grep gala")
            # So we can see the dock.
            machine.execute("pkill -f -9 io.elementary.videos")
            machine.sleep(10)
            machine.screenshot("screen")
      '';
  }
)
Loading