nixos/gnome: don't restart gnome-session-monitor.service on switch

Uses `overrideStrategy = "asDropin";` to force the creation of a drop-in.

Without this, by default, NixOS would create `gnome-session-monitor.service`
if not present. That could cause some issues as described in:

https://github.com/NixOS/nixpkgs/pull/519740#issuecomment-4457203746
This commit is contained in:
André Lima
2026-06-28 19:18:34 +01:00
parent 061964a2fc
commit 27ed79c4e5

View File

@@ -400,6 +400,15 @@ in
pkgs.xdg-user-dirs-gtk # Used to create the default bookmarks
];
# Restarting this unit terminates the active GNOME session.
systemd.user.services.gnome-session-monitor = {
restartIfChanged = false;
overrideStrategy = "asDropin";
# No need to add the NixOS default Environment="Path=coreutils:...",
# to the gnome-session-monitor service.
enableDefaultPath = false;
};
services.udev.packages = [
# Force enable KMS modifiers for devices that require them.
# https://gitlab.gnome.org/GNOME/pkgs.mutter/-/merge_requests/1443