From f4c7b95acd03c893265d3962d3797b74edd24389 Mon Sep 17 00:00:00 2001 From: nevaforget <> Date: Fri, 7 Aug 2026 12:47:29 +0200 Subject: [PATCH] Expose wayland-sessions at the FHS path moongreet expects moongreet hardcodes /usr/share/wayland-sessions in src/sessions.rs and greeter.rs calls get_sessions(None, None), so the default cannot be overridden from config. --- modules/greetd.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/greetd.nix b/modules/greetd.nix index 25ed598..56fff8b 100644 --- a/modules/greetd.nix +++ b/modules/greetd.nix @@ -39,6 +39,17 @@ in # boots into multi-user.target, where the unit never starts. systemd.defaultUnit = "graphical.target"; + # moongreet scans /usr/share/wayland-sessions and /usr/share/xsessions; + # both paths are hardcoded in src/sessions.rs and are not overridden by + # the caller in greeter.rs. NixOS collects session files under + # /run/current-system/sw/share instead, so the FHS paths are linked there. + environment.pathsToLink = [ "/share/wayland-sessions" "/share/xsessions" ]; + + systemd.tmpfiles.rules = [ + "d /usr/share 0755 root root -" + "L+ /usr/share/wayland-sessions - - - - /run/current-system/sw/share/wayland-sessions" + ]; + # The greeter session spawns `moongreet` by name from niri-greeter.kdl, # so it has to resolve in PATH. environment.systemPackages = [ moonarchPkgs.moongreet ];