nixos/pantheon: Default to wayland session (#442810)

This commit is contained in:
Bobby Rong
2025-09-15 12:57:30 +00:00
committed by GitHub
12 changed files with 69 additions and 155 deletions

2
.github/labeler.yml vendored
View File

@@ -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/**/*

View File

@@ -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`.

View File

@@ -248,6 +248,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.
- `networking.wireless.networks.<name>` now has an option to specify SSID, hence allowing duplicated SSID setup. The BSSID option is added along side with this.

View File

@@ -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.

View File

@@ -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;
@@ -114,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: ''

View File

@@ -33,7 +33,7 @@ in
./retroarch.nix
./kodi.nix
./mate.nix
./pantheon.nix
../../desktop-managers/pantheon.nix
./surf-display.nix
./cde.nix
./cinnamon.nix

View File

@@ -525,7 +525,7 @@ rec {
{ ... }:
{
services.xserver.enable = true;
services.xserver.desktopManager.pantheon.enable = true;
services.desktopManager.pantheon.enable = true;
}
);

View File

@@ -1143,7 +1143,6 @@ in
pam-zfs-key = runTest ./pam/zfs-key.nix;
pantalaimon = runTest ./matrix/pantalaimon.nix;
pantheon = runTest ./pantheon.nix;
pantheon-wayland = runTest ./pantheon-wayland.nix;
paperless = runTest ./paperless.nix;
paretosecurity = runTest ./paretosecurity.nix;
parsedmarc = handleTest ./parsedmarc { };

View File

@@ -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.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}")
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")
'';
}

View File

@@ -8,6 +8,20 @@
nodes.machine =
{ ... }:
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 ];
@@ -15,16 +29,19 @@
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;
# 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 ];
programs.ydotool.enable = true;
};
enableOCR = true;
@@ -33,7 +50,6 @@
{ nodes, ... }:
let
user = nodes.machine.users.users.alice;
bob = nodes.machine.users.users.bob;
in
''
machine.wait_for_unit("display-manager.service")
@@ -41,34 +57,34 @@
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.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_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 +92,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 +107,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")
'';

View File

@@ -140,7 +140,7 @@ cfgpantheon = """ # Enable the X11 windowing system.
# Enable the Pantheon Desktop Environment.
services.xserver.displayManager.lightdm.enable = true;
services.xserver.desktopManager.pantheon.enable = true;
services.desktopManager.pantheon.enable = true;
"""

View File

@@ -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