From b9eea406166ab5b16c950a9542b4c4a8e5e51bad Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Sun, 14 Sep 2025 10:01:28 +0800 Subject: [PATCH 1/4] nixos/pantheon: Move out of X11 The next few commits will make pantheon-wayland the default. Note that the Pantheon LightDM greeter option is left untouched right now since it still runs under X11. --- .github/labeler.yml | 2 +- nixos/doc/manual/release-notes/rl-2003.section.md | 2 +- .../services/{x11 => }/desktop-managers/pantheon.md | 6 +++--- .../{x11 => }/desktop-managers/pantheon.nix | 13 ++++++++++--- .../services/x11/desktop-managers/default.nix | 2 +- nixos/release.nix | 2 +- nixos/tests/pantheon-wayland.nix | 2 +- nixos/tests/pantheon.nix | 2 +- .../src/modules/nixos/main.py | 2 +- 9 files changed, 20 insertions(+), 13 deletions(-) rename nixos/modules/services/{x11 => }/desktop-managers/pantheon.md (94%) rename nixos/modules/services/{x11 => }/desktop-managers/pantheon.nix (97%) diff --git a/.github/labeler.yml b/.github/labeler.yml index 17f43402f0caa..d4f43e31b0841 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -393,7 +393,7 @@ - changed-files: - any-glob-to-any-file: - nixos/modules/services/desktops/pantheon/**/* - - nixos/modules/services/x11/desktop-managers/pantheon.nix + - nixos/modules/services/desktop-managers/pantheon.nix - nixos/modules/services/x11/display-managers/lightdm-greeters/pantheon.nix - nixos/tests/pantheon.nix - pkgs/desktops/pantheon/**/* diff --git a/nixos/doc/manual/release-notes/rl-2003.section.md b/nixos/doc/manual/release-notes/rl-2003.section.md index 68ccc44cce7a1..f9dee1b50f101 100644 --- a/nixos/doc/manual/release-notes/rl-2003.section.md +++ b/nixos/doc/manual/release-notes/rl-2003.section.md @@ -38,7 +38,7 @@ In addition to numerous new and upgraded packages, this release has the followin - GNOME 3 has been upgraded to 3.34. Please take a look at their [Release Notes](https://help.gnome.org/misc/release-notes/3.34) for details. -- If you enable the Pantheon Desktop Manager via [services.xserver.desktopManager.pantheon.enable](options.html#opt-services.xserver.desktopManager.pantheon.enable), we now default to also use [ Pantheon's newly designed greeter ](https://blog.elementary.io/say-hello-to-the-new-greeter/). Contrary to NixOS's usual update policy, Pantheon will receive updates during the cycle of NixOS 20.03 when backwards compatible. +- If you enable the Pantheon Desktop Manager via `services.xserver.desktopManager.pantheon.enable`, we now default to also use [ Pantheon's newly designed greeter ](https://blog.elementary.io/say-hello-to-the-new-greeter/). Contrary to NixOS's usual update policy, Pantheon will receive updates during the cycle of NixOS 20.03 when backwards compatible. - By default zfs pools will now be trimmed on a weekly basis. Trimming is only done on supported devices (i.e. NVME or SSDs) and should improve throughput and lifetime of these devices. It is controlled by the `services.zfs.trim.enable` varname. The zfs scrub service (`services.zfs.autoScrub.enable`) and the zfs autosnapshot service (`services.zfs.autoSnapshot.enable`) are now only enabled if zfs is set in `config.boot.initrd.supportedFilesystems` or `config.boot.supportedFilesystems`. These lists will automatically contain zfs as soon as any zfs mountpoint is configured in `fileSystems`. diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.md b/nixos/modules/services/desktop-managers/pantheon.md similarity index 94% rename from nixos/modules/services/x11/desktop-managers/pantheon.md rename to nixos/modules/services/desktop-managers/pantheon.md index f4c488bf6decf..ec60a5949476a 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.md +++ b/nixos/modules/services/desktop-managers/pantheon.md @@ -6,7 +6,7 @@ Pantheon is the desktop environment created for the elementary OS distribution. All of Pantheon is working in NixOS and the applications should be available, aside from a few [exceptions](https://github.com/NixOS/nixpkgs/issues/58161). To enable Pantheon, set ```nix -{ services.xserver.desktopManager.pantheon.enable = true; } +{ services.desktopManager.pantheon.enable = true; } ``` This automatically enables LightDM and Pantheon's LightDM greeter. If you'd like to disable this, set ```nix @@ -25,8 +25,8 @@ You can also use [](#opt-environment.pantheon.excludePackages) to remove any oth Wingpanel and Switchboard work differently than they do in other distributions, as far as using plugins. You cannot install a plugin globally (like with {option}`environment.systemPackages`) to start using it. You should instead be using the following options: - - [](#opt-services.xserver.desktopManager.pantheon.extraWingpanelIndicators) - - [](#opt-services.xserver.desktopManager.pantheon.extraSwitchboardPlugs) + - [](#opt-services.desktopManager.pantheon.extraWingpanelIndicators) + - [](#opt-services.desktopManager.pantheon.extraSwitchboardPlugs) to configure the programs with plugs or indicators. diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/desktop-managers/pantheon.nix similarity index 97% rename from nixos/modules/services/x11/desktop-managers/pantheon.nix rename to nixos/modules/services/desktop-managers/pantheon.nix index 8be5d1cdb7b76..407f31cda7ff6 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.nix +++ b/nixos/modules/services/desktop-managers/pantheon.nix @@ -10,7 +10,7 @@ with lib; let - cfg = config.services.xserver.desktopManager.pantheon; + cfg = config.services.desktopManager.pantheon; serviceCfg = config.services.pantheon; nixos-gsettings-desktop-schemas = pkgs.pantheon.elementary-gsettings-schemas.override { @@ -28,6 +28,13 @@ in maintainers = teams.pantheon.members; }; + imports = [ + (lib.mkRenamedOptionModule + [ "services" "xserver" "desktopManager" "pantheon" ] + [ "services" "desktopManager" "pantheon" ] + ) + ]; + options = { services.pantheon = { @@ -40,7 +47,7 @@ in }; - services.xserver.desktopManager.pantheon = { + services.desktopManager.pantheon = { enable = mkOption { type = types.bool; default = false; @@ -98,7 +105,7 @@ in config = mkMerge [ (mkIf cfg.enable { - services.xserver.desktopManager.pantheon.sessionPath = utils.removePackagesByName [ + services.desktopManager.pantheon.sessionPath = utils.removePackagesByName [ pkgs.pantheon.pantheon-agent-geoclue2 ] config.environment.pantheon.excludePackages; diff --git a/nixos/modules/services/x11/desktop-managers/default.nix b/nixos/modules/services/x11/desktop-managers/default.nix index 25fc53285aa77..528a049b35824 100644 --- a/nixos/modules/services/x11/desktop-managers/default.nix +++ b/nixos/modules/services/x11/desktop-managers/default.nix @@ -33,7 +33,7 @@ in ./retroarch.nix ./kodi.nix ./mate.nix - ./pantheon.nix + ../../desktop-managers/pantheon.nix ./surf-display.nix ./cde.nix ./cinnamon.nix diff --git a/nixos/release.nix b/nixos/release.nix index 207d76704b5e5..e5530525ffb71 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -619,7 +619,7 @@ rec { { ... }: { services.xserver.enable = true; - services.xserver.desktopManager.pantheon.enable = true; + services.desktopManager.pantheon.enable = true; } ); diff --git a/nixos/tests/pantheon-wayland.nix b/nixos/tests/pantheon-wayland.nix index 87c8b17a692c6..07732dc15399e 100644 --- a/nixos/tests/pantheon-wayland.nix +++ b/nixos/tests/pantheon-wayland.nix @@ -29,7 +29,7 @@ virtualisation.memorySize = 2047; services.xserver.enable = true; - services.xserver.desktopManager.pantheon.enable = true; + services.desktopManager.pantheon.enable = true; services.displayManager = { autoLogin.enable = true; autoLogin.user = nodes.machine.users.users.alice.name; diff --git a/nixos/tests/pantheon.nix b/nixos/tests/pantheon.nix index 855d0f48f80c0..4e0f2f4f48639 100644 --- a/nixos/tests/pantheon.nix +++ b/nixos/tests/pantheon.nix @@ -15,7 +15,7 @@ virtualisation.memorySize = 2047; services.xserver.enable = true; - services.xserver.desktopManager.pantheon.enable = true; + services.desktopManager.pantheon.enable = true; # We ship pantheon.appcenter by default when this is enabled. services.flatpak.enable = true; diff --git a/pkgs/by-name/ca/calamares-nixos-extensions/src/modules/nixos/main.py b/pkgs/by-name/ca/calamares-nixos-extensions/src/modules/nixos/main.py index d947fdf296b85..85e259d42d11e 100644 --- a/pkgs/by-name/ca/calamares-nixos-extensions/src/modules/nixos/main.py +++ b/pkgs/by-name/ca/calamares-nixos-extensions/src/modules/nixos/main.py @@ -140,7 +140,7 @@ # Enable the Pantheon Desktop Environment. services.xserver.displayManager.lightdm.enable = true; - services.xserver.desktopManager.pantheon.enable = true; + services.desktopManager.pantheon.enable = true; """ From c40ffeccd1ba02c2d93b47e87b5b5bd2af537b26 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Sun, 14 Sep 2025 11:28:52 +0800 Subject: [PATCH 2/4] nixos/tests/pantheon: Only test wayland session This copies the previous pantheon-wayland test to pantheon. --- nixos/tests/all-tests.nix | 1 - nixos/tests/pantheon-wayland.nix | 104 ------------------------------- nixos/tests/pantheon.nix | 82 +++++++++++------------- 3 files changed, 35 insertions(+), 152 deletions(-) delete mode 100644 nixos/tests/pantheon-wayland.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 46fa3160cb69b..8320340d98324 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -1146,7 +1146,6 @@ in patroni = handleTestOn [ "x86_64-linux" ] ./patroni.nix { }; pantalaimon = runTest ./matrix/pantalaimon.nix; pantheon = runTest ./pantheon.nix; - pantheon-wayland = runTest ./pantheon-wayland.nix; paperless = runTest ./paperless.nix; parsedmarc = handleTest ./parsedmarc { }; password-option-override-ordering = runTest ./password-option-override-ordering.nix; diff --git a/nixos/tests/pantheon-wayland.nix b/nixos/tests/pantheon-wayland.nix deleted file mode 100644 index 07732dc15399e..0000000000000 --- a/nixos/tests/pantheon-wayland.nix +++ /dev/null @@ -1,104 +0,0 @@ -{ 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.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}") - machine.wait_until_succeeds("pgrep -xf ${pkgs.pantheon.elementary-files}/libexec/io.elementary.files.xdg-desktop-portal") - - 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'") - # Hopefully from gcr-ssh-agent. - machine.succeed(f"{cmd} | grep 'SSH_AUTH_SOCK' | grep 'gcr'") - - 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") - ''; -} diff --git a/nixos/tests/pantheon.nix b/nixos/tests/pantheon.nix index 4e0f2f4f48639..6b92811ea3161 100644 --- a/nixos/tests/pantheon.nix +++ b/nixos/tests/pantheon.nix @@ -6,8 +6,22 @@ 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 ]; @@ -16,15 +30,21 @@ services.xserver.enable = true; services.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 ]; - - environment.systemPackages = [ pkgs.xdotool ]; }; enableOCR = true; @@ -33,42 +53,27 @@ { nodes, ... }: let user = nodes.machine.users.users.alice; - bob = nodes.machine.users.users.bob; in '' machine.wait_for_unit("display-manager.service") - with subtest("Test we can see usernames in elementary-greeter"): - machine.wait_for_text("${user.description}") - machine.wait_until_succeeds("pgrep -f io.elementary.greeter-compositor") - # OCR was struggling with this one. - # machine.wait_for_text("${bob.description}") - # Ensure the password box is focused by clicking it. - # Workaround for https://github.com/NixOS/nixpkgs/issues/211366. - machine.succeed("XAUTHORITY=/var/lib/lightdm/.Xauthority DISPLAY=:0 xdotool mousemove 512 505 click 1") - machine.sleep(2) - machine.screenshot("elementary_greeter_lightdm") - - with subtest("Login with elementary-greeter"): - machine.send_chars("${user.password}\n") - machine.wait_for_x() - machine.wait_for_file("${user.home}/.Xauthority") - machine.succeed("xauth merge ${user.home}/.Xauthority") - machine.wait_until_succeeds('journalctl -t gnome-session-binary --grep "Entering running state"') + 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"): - for i in ["gala", "io.elementary.wingpanel", "io.elementary.dock", "gsd-media-keys", "io.elementary.desktop.agent-polkit"]: + # 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 ["gala", "io.elementary.wingpanel", "io.elementary.dock"]: - machine.wait_for_window(i) machine.wait_until_succeeds("pgrep -xf ${pkgs.pantheon.elementary-files}/libexec/io.elementary.files.xdg-desktop-portal") 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. @@ -76,31 +81,14 @@ # Hopefully from gcr-ssh-agent. machine.succeed(f"{cmd} | grep 'SSH_AUTH_SOCK' | grep 'gcr'") - with subtest("Open elementary videos"): - machine.execute("su - ${user.name} -c 'DISPLAY=:0 io.elementary.videos >&2 &'") - machine.sleep(2) - machine.wait_for_window("io.elementary.videos") + with subtest("Wait for elementary videos autostart"): + machine.wait_until_succeeds("pgrep -f io.elementary.videos") machine.wait_for_text("No Videos Open") - - with subtest("Open elementary calendar"): - machine.wait_until_succeeds("pgrep -f evolution-calendar-factory") - machine.execute("su - ${user.name} -c 'DISPLAY=:0 io.elementary.calendar >&2 &'") - machine.sleep(2) - machine.wait_for_window("io.elementary.calendar") - - with subtest("Open system settings"): - machine.execute("su - ${user.name} -c 'DISPLAY=:0 io.elementary.settings >&2 &'") - # Wait for all plugins to be loaded before we check if the window is still there. - machine.sleep(5) - machine.wait_for_window("io.elementary.settings") - - with subtest("Open elementary terminal"): - machine.execute("su - ${user.name} -c 'DISPLAY=:0 io.elementary.terminal >&2 &'") - machine.wait_for_window("io.elementary.terminal") + 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 DISPLAY=:0" + 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") @@ -108,8 +96,8 @@ with subtest("Check if gala has ever coredumped"): machine.fail("coredumpctl --json=short | grep gala") - # So you can see the dock in the below screenshot. - machine.succeed("su - ${user.name} -c 'DISPLAY=:0 xdotool mousemove 450 1000 >&2 &'") + # So we can see the dock. + machine.execute("pkill -f -9 io.elementary.videos") machine.sleep(10) machine.screenshot("screen") ''; From f5a80001507213f1cfd309259d8b81edae70344a Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Sun, 14 Sep 2025 11:14:41 +0800 Subject: [PATCH 3/4] nixos/pantheon, pantheon.elementary-greeter: Default to pantheon-wayland session See elementary/session-settings issue 91. --- nixos/doc/manual/release-notes/rl-2511.section.md | 2 ++ nixos/modules/services/desktop-managers/pantheon.nix | 9 ++++++++- nixos/tests/pantheon.nix | 1 - .../pantheon/desktop/elementary-greeter/default.nix | 10 +++++++--- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2511.section.md b/nixos/doc/manual/release-notes/rl-2511.section.md index fbc2a0a100ddc..636be077d1350 100644 --- a/nixos/doc/manual/release-notes/rl-2511.section.md +++ b/nixos/doc/manual/release-notes/rl-2511.section.md @@ -244,6 +244,8 @@ - mate-wayland-session 1.28.4 is now using the default wayfire decorator instead of firedecor, thus `services.xserver.desktopManager.mate.enableWaylandSession` is no longer shipping firedecor. If you are experiencing broken window decorations after upgrade, backup and remove `~/.config/mate/wayfire.ini` and re-login. +- Due to [deprecation of gnome-session X11 support](https://blogs.gnome.org/alatiera/2025/06/08/the-x11-session-removal/), `services.desktopManager.pantheon` now defaults to pantheon-wayland session. The X11 session will be removed before gnome-session 49 lands. + - `services.gitea` supports sending notifications with sendmail again. To do this, activate the parameter `services.gitea.mailerUseSendmail` and configure SMTP server. - Revamp of the ACME certificate acquisication and renewal process to help scale systems with lots (100+) of certificates. diff --git a/nixos/modules/services/desktop-managers/pantheon.nix b/nixos/modules/services/desktop-managers/pantheon.nix index 407f31cda7ff6..d8beeca81b0d0 100644 --- a/nixos/modules/services/desktop-managers/pantheon.nix +++ b/nixos/modules/services/desktop-managers/pantheon.nix @@ -121,7 +121,14 @@ in # Without this, elementary LightDM greeter will pre-select non-existent `default` session # https://github.com/elementary/greeter/issues/368 - services.displayManager.defaultSession = mkDefault "pantheon"; + services.displayManager.defaultSession = mkDefault "pantheon-wayland"; + programs.dconf.profiles.user.databases = [ + { + settings."io/elementary/greeter" = { + last-session-type = "pantheon-wayland"; + }; + } + ]; environment.extraInit = '' ${concatMapStrings (p: '' diff --git a/nixos/tests/pantheon.nix b/nixos/tests/pantheon.nix index 6b92811ea3161..7ceba2e30cb3a 100644 --- a/nixos/tests/pantheon.nix +++ b/nixos/tests/pantheon.nix @@ -33,7 +33,6 @@ 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. diff --git a/pkgs/desktops/pantheon/desktop/elementary-greeter/default.nix b/pkgs/desktops/pantheon/desktop/elementary-greeter/default.nix index 8197426437242..fd296dd497909 100644 --- a/pkgs/desktops/pantheon/desktop/elementary-greeter/default.nix +++ b/pkgs/desktops/pantheon/desktop/elementary-greeter/default.nix @@ -20,6 +20,7 @@ gnome-settings-daemon, mutter, elementary-icon-theme, + elementary-settings-daemon, wingpanel-with-indicators, elementary-gtk-theme, nixos-artwork, @@ -33,13 +34,15 @@ stdenv.mkDerivation rec { pname = "elementary-greeter"; - version = "8.0.1"; + # To allow overriding last-session-type. + # nixpkgs-update: no auto update + version = "8.0.1-unstable-2025-09-14"; src = fetchFromGitHub { owner = "elementary"; repo = "greeter"; - rev = version; - sha256 = "sha256-T/tI8WRVbTLdolDYa98M2Vm26p0xhGiai74lXAlpQ8k="; + rev = "2461ad1be4a4d0e541879abe869cf8911f505215"; + hash = "sha256-rDlaL2KCm0tz73cwHLgNAD7Ddbn1QFJVa+Syh5eTfWo="; }; patches = [ @@ -65,6 +68,7 @@ stdenv.mkDerivation rec { buildInputs = [ accountsservice elementary-icon-theme + elementary-settings-daemon gala # for io.elementary.desktop.background gnome-desktop gnome-settings-daemon From 03515b65f3068f0292934cbca585ce0000baab2f Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Sun, 14 Sep 2025 12:03:36 +0800 Subject: [PATCH 4/4] nixos/tests/pantheon: Restore greeter test Using ydotool this time. --- nixos/tests/pantheon.nix | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/nixos/tests/pantheon.nix b/nixos/tests/pantheon.nix index 7ceba2e30cb3a..b44065ebacdbf 100644 --- a/nixos/tests/pantheon.nix +++ b/nixos/tests/pantheon.nix @@ -6,7 +6,7 @@ meta.maintainers = lib.teams.pantheon.members; nodes.machine = - { nodes, ... }: + { ... }: let videosAutostart = pkgs.writeTextFile { @@ -30,10 +30,6 @@ services.xserver.enable = true; services.desktopManager.pantheon.enable = true; - services.displayManager = { - autoLogin.enable = true; - autoLogin.user = nodes.machine.users.users.alice.name; - }; # We ship pantheon.appcenter by default when this is enabled. services.flatpak.enable = true; @@ -44,6 +40,8 @@ # 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 ]; + + programs.ydotool.enable = true; }; enableOCR = true; @@ -56,6 +54,20 @@ '' machine.wait_for_unit("display-manager.service") + with subtest("Test we can see usernames in elementary-greeter"): + machine.wait_for_text("${user.description}") + machine.wait_until_succeeds("pgrep -f io.elementary.greeter-compositor") + # Ensure the password box is focused by clicking it. + # Workaround for https://github.com/NixOS/nixpkgs/issues/211366. + machine.succeed("ydotool mousemove -a 220 275") + machine.succeed("ydotool click 0xC0") + machine.sleep(2) + machine.screenshot("elementary_greeter_lightdm") + + with subtest("Login with elementary-greeter"): + machine.send_chars("${user.password}\n") + machine.wait_until_succeeds('journalctl -t gnome-session-binary --grep "Entering running state"') + with subtest("Wait for wayland server"): machine.wait_for_file("/run/user/${toString user.uid}/wayland-0")