fix(lightdm): expose Nix desktop entries on Arch #96

Merged
lost-rob0t merged 4 commits from fix/lightdm-arch-xdg-data-dirs into master 2026-08-22 02:37:59 +00:00
lost-rob0t commented 2026-08-22 00:29:49 +00:00 (Migrated from github.com)

Root cause

After moving the Arch Qtile session to LightDM, j4-dmenu-desktop can still see Arch-installed applications such as Firefox but misses applications installed through Nix/Home Manager. LightDM launches Qtile outside the interactive shell, so desktop-entry discovery depends on the environment exported by .xprofile.

The previous fix only prepended ~/.nix-profile/share and trusted whatever Home Manager supplied in XDG_DATA_DIRS. That is not sufficient for every Nix profile layout used on a non-NixOS host.

Fix

  • build XDG_DATA_DIRS explicitly in .xprofile for the LightDM session;
  • include legacy ~/.nix-profile/share;
  • include the modern ~/.local/state/nix/profiles/profile/share path;
  • include multi-user /nix/var/nix/profiles/per-user/$USER/profile/share;
  • include /etc/profiles/per-user/$USER/share when present in the deployment model;
  • preserve any directories supplied by Home Manager;
  • always retain Arch /usr/local/share and /usr/share;
  • import XDG_DATA_HOME and the corrected XDG_DATA_DIRS into the user systemd environment.

Regression coverage

The launcher regression now executes .xprofile in a synthetic LightDM-style environment with Home Manager supplying its own XDG_DATA_DIRS, then verifies both Arch and Nix application roots survive and no duplicate directories are introduced.

No NixOS host/session configuration is changed.

## Root cause After moving the Arch Qtile session to LightDM, `j4-dmenu-desktop` can still see Arch-installed applications such as Firefox but misses applications installed through Nix/Home Manager. LightDM launches Qtile outside the interactive shell, so desktop-entry discovery depends on the environment exported by `.xprofile`. The previous fix only prepended `~/.nix-profile/share` and trusted whatever Home Manager supplied in `XDG_DATA_DIRS`. That is not sufficient for every Nix profile layout used on a non-NixOS host. ## Fix - build `XDG_DATA_DIRS` explicitly in `.xprofile` for the LightDM session; - include legacy `~/.nix-profile/share`; - include the modern `~/.local/state/nix/profiles/profile/share` path; - include multi-user `/nix/var/nix/profiles/per-user/$USER/profile/share`; - include `/etc/profiles/per-user/$USER/share` when present in the deployment model; - preserve any directories supplied by Home Manager; - always retain Arch `/usr/local/share` and `/usr/share`; - import `XDG_DATA_HOME` and the corrected `XDG_DATA_DIRS` into the user systemd environment. ## Regression coverage The launcher regression now executes `.xprofile` in a synthetic LightDM-style environment with Home Manager supplying its own `XDG_DATA_DIRS`, then verifies both Arch and Nix application roots survive and no duplicate directories are introduced. No NixOS host/session configuration is changed.
Sign in to join this conversation.
No description provided.