diff --git a/nixos/modules/programs/wayland/niri.nix b/nixos/modules/programs/wayland/niri.nix index 05a9deadf33e..31cc485c4e00 100644 --- a/nixos/modules/programs/wayland/niri.nix +++ b/nixos/modules/programs/wayland/niri.nix @@ -40,6 +40,17 @@ in systemd.packages = [ cfg.package ]; + # Restarting the compositor kills the graphical session; same + # treatment as the display-manager modules. + systemd.user.services.niri = { + restartIfChanged = false; + # Defining the unit here generates a drop-in; without this it + # would carry the NixOS default Environment="PATH=coreutils:…", + # clobbering the PATH that niri-session imported into the user + # manager and breaking spawn actions that rely on it. + enableDefaultPath = false; + }; + xdg.portal = { enable = lib.mkDefault true;