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

Changed files
+69 -155
.github
nixos
doc
manual
modules
services
desktop-managers
x11
desktop-managers
tests
pkgs
by-name
ca
calamares-nixos-extensions
src
modules
nixos
desktops
pantheon
desktop
elementary-greeter
+1 -1
.github/labeler.yml
···
- 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/**/*
+1 -1
nixos/doc/manual/release-notes/rl-2003.section.md
···
- 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`.
+2
nixos/doc/manual/release-notes/rl-2511.section.md
···
- 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.
+1 -1
nixos/modules/services/x11/desktop-managers/default.nix
···
./retroarch.nix
./kodi.nix
./mate.nix
-
./pantheon.nix
+
../../desktop-managers/pantheon.nix
./surf-display.nix
./cde.nix
./cinnamon.nix
+3 -3
nixos/modules/services/x11/desktop-managers/pantheon.md nixos/modules/services/desktop-managers/pantheon.md
···
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
···
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.
+18 -4
nixos/modules/services/x11/desktop-managers/pantheon.nix nixos/modules/services/desktop-managers/pantheon.nix
···
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 {
···
maintainers = teams.pantheon.members;
};
+
imports = [
+
(lib.mkRenamedOptionModule
+
[ "services" "xserver" "desktopManager" "pantheon" ]
+
[ "services" "desktopManager" "pantheon" ]
+
)
+
];
+
options = {
services.pantheon = {
···
};
-
services.xserver.desktopManager.pantheon = {
+
services.desktopManager.pantheon = {
enable = mkOption {
type = types.bool;
default = false;
···
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;
···
# 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: ''
+1 -1
nixos/release.nix
···
{ ... }:
{
services.xserver.enable = true;
-
services.xserver.desktopManager.pantheon.enable = true;
+
services.desktopManager.pantheon.enable = true;
}
);
-1
nixos/tests/all-tests.nix
···
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 { };
-104
nixos/tests/pantheon-wayland.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}")
-
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")
-
'';
-
}
+34 -35
nixos/tests/pantheon.nix
···
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 ];
···
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;
···
{ 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.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.
···
# 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")
···
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")
'';
+1 -1
pkgs/by-name/ca/calamares-nixos-extensions/src/modules/nixos/main.py
···
# Enable the Pantheon Desktop Environment.
services.xserver.displayManager.lightdm.enable = true;
-
services.xserver.desktopManager.pantheon.enable = true;
+
services.desktopManager.pantheon.enable = true;
"""
+7 -3
pkgs/desktops/pantheon/desktop/elementary-greeter/default.nix
···
gnome-settings-daemon,
mutter,
elementary-icon-theme,
+
elementary-settings-daemon,
wingpanel-with-indicators,
elementary-gtk-theme,
nixos-artwork,
···
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 = [
···
buildInputs = [
accountsservice
elementary-icon-theme
+
elementary-settings-daemon
gala # for io.elementary.desktop.background
gnome-desktop
gnome-settings-daemon